Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 72aeea48 authored by Joe Perches's avatar Joe Perches Committed by Michael Grzeschik
Browse files

arcnet: Expand odd BUGLVL macro with if and uses



Don't hide what should be obvious.

Make the macro a simple test instead of using if and test.

Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarMichael Grzeschik <m.grzeschik@pengutronix.de>
parent d77510f3
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -117,7 +117,8 @@ static void rx(struct net_device *dev, int bufnum,
				      pkt->soft.raw + sizeof(pkt->soft),
				      length - sizeof(pkt->soft));

	BUGLVL(D_SKB) arcnet_dump_skb(dev, skb, "rx");
	if (BUGLVL(D_SKB))
		arcnet_dump_skb(dev, skb, "rx");

	skb->protocol = cpu_to_be16(ETH_P_ARCNET);
	netif_rx(skb);
+12 −8
Original line number Diff line number Diff line
@@ -82,18 +82,21 @@ static void arcrimi_copy_from_card(struct net_device *dev, int bufnum, int offse
 */
static int __init arcrimi_probe(struct net_device *dev)
{
	BUGLVL(D_NORMAL) printk(VERSION);
	BUGLVL(D_NORMAL) printk("E-mail me if you actually test the RIM I driver, please!\n");

	BUGLVL(D_NORMAL) printk("Given: node %02Xh, shmem %lXh, irq %d\n",
	if (BUGLVL(D_NORMAL)) {
		printk(VERSION);
		printk("E-mail me if you actually test the RIM I driver, please!\n");
		printk("Given: node %02Xh, shmem %lXh, irq %d\n",
		       dev->dev_addr[0], dev->mem_start, dev->irq);
	}

	if (dev->mem_start <= 0 || dev->irq <= 0) {
		BUGLVL(D_NORMAL) printk("No autoprobe for RIM I; you must specify the shmem and irq!\n");
		if (BUGLVL(D_NORMAL))
			printk("No autoprobe for RIM I; you must specify the shmem and irq!\n");
		return -ENODEV;
	}
	if (dev->dev_addr[0] == 0) {
		BUGLVL(D_NORMAL) printk("You need to specify your card's station ID!\n");
		if (BUGLVL(D_NORMAL))
			printk("You need to specify your card's station ID!\n");
		return -ENODEV;
	}
	/* Grab the memory region at mem_start for MIRROR_SIZE bytes.
@@ -102,7 +105,8 @@ static int __init arcrimi_probe(struct net_device *dev)
	 * will be taken.
	 */
	if (!request_mem_region(dev->mem_start, MIRROR_SIZE, "arcnet (90xx)")) {
		BUGLVL(D_NORMAL) printk("Card memory already allocated\n");
		if (BUGLVL(D_NORMAL))
			printk("Card memory already allocated\n");
		return -ENODEV;
	}
	return arcrimi_found(dev);
+16 −13
Original line number Diff line number Diff line
@@ -117,7 +117,7 @@ static int __init arcnet_init(void)
	printk("arcnet loaded.\n");

#ifdef ALPHA_WARNING
	BUGLVL(D_EXTRA) {
	if (BUGLVL(D_EXTRA)) {
		printk("arcnet: ***\n"
		"arcnet: * Read arcnet.txt for important release notes!\n"
		       "arcnet: *\n"
@@ -132,7 +132,7 @@ static int __init arcnet_init(void)
	for (count = 0; count < 256; count++)
		arc_proto_map[count] = arc_proto_default;

	BUGLVL(D_DURING)
	if (BUGLVL(D_DURING))
		printk("arcnet: struct sizes: %Zd %Zd %Zd %Zd %Zd\n",
		       sizeof(struct arc_hardware), sizeof(struct arc_rfc1201),
		       sizeof(struct arc_rfc1051), sizeof(struct arc_eth_encap),
@@ -235,7 +235,7 @@ static void release_arcbuf(struct net_device *dev, int bufnum)
	lp->buf_queue[lp->first_free_buf++] = bufnum;
	lp->first_free_buf %= 5;

	BUGLVL(D_DURING) {
	if (BUGLVL(D_DURING)) {
		BUGMSG(D_DURING, "release_arcbuf: freed #%d; buffer queue is now: ",
		       bufnum);
		for (i = lp->next_buf; i != lp->first_free_buf; i = (i + 1) % 5)
@@ -268,7 +268,7 @@ static int get_arcbuf(struct net_device *dev)
		}
	}

	BUGLVL(D_DURING) {
	if (BUGLVL(D_DURING)) {
		BUGMSG(D_DURING, "get_arcbuf: got #%d; buffer queue is now: ", buf);
		for (i = lp->next_buf; i != lp->first_free_buf; i = (i + 1) % 5)
			BUGMSG2(D_DURING, "#%d ", lp->buf_queue[i]);
@@ -356,7 +356,7 @@ int arcnet_open(struct net_device *dev)
	if (!try_module_get(lp->hw.owner))
		return -ENODEV;

	BUGLVL(D_PROTO) {
	if (BUGLVL(D_PROTO)) {
		BUGMSG(D_PROTO, "protocol map (default is '%c'): ",
		       arc_proto_default->suffix);
		for (count = 0; count < 256; count++)
@@ -531,7 +531,8 @@ netdev_tx_t arcnet_send_packet(struct sk_buff *skb,

	BUGMSG(D_SKB_SIZE, "skb: transmitting %d bytes to %02X\n",
	       skb->len, pkt->hard.dest);
	BUGLVL(D_SKB) arcnet_dump_skb(dev, skb, "tx");
	if (BUGLVL(D_SKB))
		arcnet_dump_skb(dev, skb, "tx");

	/* fits in one packet? */
	if (skb->len - ARC_HDR_SIZE > XMTU && !proto->continue_tx) {
@@ -609,7 +610,8 @@ static int go_tx(struct net_device *dev)
	if (lp->cur_tx != -1 || lp->next_tx == -1)
		return 0;

	BUGLVL(D_TX) arcnet_dump_packet(dev, lp->next_tx, "go_tx", 0);
	if (BUGLVL(D_TX))
		arcnet_dump_packet(dev, lp->next_tx, "go_tx", 0);

	lp->cur_tx = lp->next_tx;
	lp->next_tx = -1;
@@ -822,7 +824,8 @@ irqreturn_t arcnet_interrupt(int irq, void *dev_id)
		}
		/* now process the received packet, if any */
		if (recbuf != -1) {
			BUGLVL(D_RX) arcnet_dump_packet(dev, recbuf, "rx irq", 0);
			if (BUGLVL(D_RX))
				arcnet_dump_packet(dev, recbuf, "rx irq", 0);

			arcnet_rx(dev, recbuf);
			release_arcbuf(dev, recbuf);
@@ -938,7 +941,7 @@ static void arcnet_rx(struct net_device *dev, int bufnum)

	/* call the right receiver for the protocol */
	if (arc_proto_map[soft->proto]->is_ip) {
		BUGLVL(D_PROTO) {
		if (BUGLVL(D_PROTO)) {
			struct ArcProto
			*oldp = arc_proto_map[lp->default_proto[pkt.hard.source]],
			*newp = arc_proto_map[soft->proto];
+6 −3
Original line number Diff line number Diff line
@@ -84,7 +84,8 @@ static void rx(struct net_device *dev, int bufnum,
				      + sizeof(int),
				      length - sizeof(pkt->soft));

	BUGLVL(D_SKB) arcnet_dump_skb(dev, skb, "rx");
	if (BUGLVL(D_SKB))
		arcnet_dump_skb(dev, skb, "rx");

	skb->protocol = cpu_to_be16(ETH_P_ARCNET);
	netif_rx(skb);
@@ -190,7 +191,8 @@ static int ack_tx(struct net_device *dev, int acked)
	BUGMSG(D_DURING, "capmode: ack_tx: protocol: %x: result: %d\n",
	       lp->outgoing.skb->protocol, acked);

	BUGLVL(D_SKB) arcnet_dump_skb(dev, lp->outgoing.skb, "ack_tx");
	if (BUGLVL(D_SKB))
		arcnet_dump_skb(dev, lp->outgoing.skb, "ack_tx");

	/* Now alloc a skb to send back up through the layers: */
	ackskb = alloc_skb(length + ARC_HDR_SIZE, GFP_ATOMIC);
@@ -216,7 +218,8 @@ static int ack_tx(struct net_device *dev, int acked)

	ackskb->protocol = cpu_to_be16(ETH_P_ARCNET);

	BUGLVL(D_SKB) arcnet_dump_skb(dev, ackskb, "ack_tx_recv");
	if (BUGLVL(D_SKB))
		arcnet_dump_skb(dev, ackskb, "ack_tx_recv");
	netif_rx(ackskb);

free_outskb:
+2 −1
Original line number Diff line number Diff line
@@ -53,7 +53,8 @@ static int __init com20020isa_probe(struct net_device *dev)
	struct arcnet_local *lp = netdev_priv(dev);
	int err;

	BUGLVL(D_NORMAL) printk(VERSION);
	if (BUGLVL(D_NORMAL))
		printk(VERSION);

	ioaddr = dev->base_addr;
	if (!ioaddr) {
Loading