diff options
author | Joe Perches <joe@perches.com> | 2015-05-05 13:05:54 -0400 |
---|---|---|
committer | Michael Grzeschik <m.grzeschik@pengutronix.de> | 2015-09-23 02:44:24 -0400 |
commit | 72aeea4841c037b9b3abf65859673cbd7b6664a9 (patch) | |
tree | c3971feaa487b367d3055d39de981ad86562196b | |
parent | d77510f3436e0db9b5e72fa8159ce26c3ac88d2d (diff) |
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: Joe Perches <joe@perches.com>
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
-rw-r--r-- | drivers/net/arcnet/arc-rawmode.c | 3 | ||||
-rw-r--r-- | drivers/net/arcnet/arc-rimi.c | 20 | ||||
-rw-r--r-- | drivers/net/arcnet/arcnet.c | 29 | ||||
-rw-r--r-- | drivers/net/arcnet/capmode.c | 9 | ||||
-rw-r--r-- | drivers/net/arcnet/com20020-isa.c | 3 | ||||
-rw-r--r-- | drivers/net/arcnet/com20020-pci.c | 3 | ||||
-rw-r--r-- | drivers/net/arcnet/com20020.c | 3 | ||||
-rw-r--r-- | drivers/net/arcnet/com90io.c | 6 | ||||
-rw-r--r-- | drivers/net/arcnet/com90xx.c | 49 | ||||
-rw-r--r-- | drivers/net/arcnet/rfc1051.c | 3 | ||||
-rw-r--r-- | drivers/net/arcnet/rfc1201.c | 6 | ||||
-rw-r--r-- | include/linux/arcdevice.h | 17 |
12 files changed, 93 insertions, 58 deletions
diff --git a/drivers/net/arcnet/arc-rawmode.c b/drivers/net/arcnet/arc-rawmode.c index efdd8e95a2bf..998c8356e576 100644 --- a/drivers/net/arcnet/arc-rawmode.c +++ b/drivers/net/arcnet/arc-rawmode.c | |||
@@ -117,7 +117,8 @@ static void rx(struct net_device *dev, int bufnum, | |||
117 | pkt->soft.raw + sizeof(pkt->soft), | 117 | pkt->soft.raw + sizeof(pkt->soft), |
118 | length - sizeof(pkt->soft)); | 118 | length - sizeof(pkt->soft)); |
119 | 119 | ||
120 | BUGLVL(D_SKB) arcnet_dump_skb(dev, skb, "rx"); | 120 | if (BUGLVL(D_SKB)) |
121 | arcnet_dump_skb(dev, skb, "rx"); | ||
121 | 122 | ||
122 | skb->protocol = cpu_to_be16(ETH_P_ARCNET); | 123 | skb->protocol = cpu_to_be16(ETH_P_ARCNET); |
123 | netif_rx(skb); | 124 | netif_rx(skb); |
diff --git a/drivers/net/arcnet/arc-rimi.c b/drivers/net/arcnet/arc-rimi.c index c7ab23e8ec6a..cd47a1b3008c 100644 --- a/drivers/net/arcnet/arc-rimi.c +++ b/drivers/net/arcnet/arc-rimi.c | |||
@@ -82,18 +82,21 @@ static void arcrimi_copy_from_card(struct net_device *dev, int bufnum, int offse | |||
82 | */ | 82 | */ |
83 | static int __init arcrimi_probe(struct net_device *dev) | 83 | static int __init arcrimi_probe(struct net_device *dev) |
84 | { | 84 | { |
85 | BUGLVL(D_NORMAL) printk(VERSION); | 85 | if (BUGLVL(D_NORMAL)) { |
86 | BUGLVL(D_NORMAL) printk("E-mail me if you actually test the RIM I driver, please!\n"); | 86 | printk(VERSION); |
87 | 87 | printk("E-mail me if you actually test the RIM I driver, please!\n"); | |
88 | BUGLVL(D_NORMAL) printk("Given: node %02Xh, shmem %lXh, irq %d\n", | 88 | printk("Given: node %02Xh, shmem %lXh, irq %d\n", |
89 | dev->dev_addr[0], dev->mem_start, dev->irq); | 89 | dev->dev_addr[0], dev->mem_start, dev->irq); |
90 | } | ||
90 | 91 | ||
91 | if (dev->mem_start <= 0 || dev->irq <= 0) { | 92 | if (dev->mem_start <= 0 || dev->irq <= 0) { |
92 | BUGLVL(D_NORMAL) printk("No autoprobe for RIM I; you must specify the shmem and irq!\n"); | 93 | if (BUGLVL(D_NORMAL)) |
94 | printk("No autoprobe for RIM I; you must specify the shmem and irq!\n"); | ||
93 | return -ENODEV; | 95 | return -ENODEV; |
94 | } | 96 | } |
95 | if (dev->dev_addr[0] == 0) { | 97 | if (dev->dev_addr[0] == 0) { |
96 | BUGLVL(D_NORMAL) printk("You need to specify your card's station ID!\n"); | 98 | if (BUGLVL(D_NORMAL)) |
99 | printk("You need to specify your card's station ID!\n"); | ||
97 | return -ENODEV; | 100 | return -ENODEV; |
98 | } | 101 | } |
99 | /* Grab the memory region at mem_start for MIRROR_SIZE bytes. | 102 | /* Grab the memory region at mem_start for MIRROR_SIZE bytes. |
@@ -102,7 +105,8 @@ static int __init arcrimi_probe(struct net_device *dev) | |||
102 | * will be taken. | 105 | * will be taken. |
103 | */ | 106 | */ |
104 | if (!request_mem_region(dev->mem_start, MIRROR_SIZE, "arcnet (90xx)")) { | 107 | if (!request_mem_region(dev->mem_start, MIRROR_SIZE, "arcnet (90xx)")) { |
105 | BUGLVL(D_NORMAL) printk("Card memory already allocated\n"); | 108 | if (BUGLVL(D_NORMAL)) |
109 | printk("Card memory already allocated\n"); | ||
106 | return -ENODEV; | 110 | return -ENODEV; |
107 | } | 111 | } |
108 | return arcrimi_found(dev); | 112 | return arcrimi_found(dev); |
diff --git a/drivers/net/arcnet/arcnet.c b/drivers/net/arcnet/arcnet.c index 605b4a7abecc..7a90b8a45a37 100644 --- a/drivers/net/arcnet/arcnet.c +++ b/drivers/net/arcnet/arcnet.c | |||
@@ -117,7 +117,7 @@ static int __init arcnet_init(void) | |||
117 | printk("arcnet loaded.\n"); | 117 | printk("arcnet loaded.\n"); |
118 | 118 | ||
119 | #ifdef ALPHA_WARNING | 119 | #ifdef ALPHA_WARNING |
120 | BUGLVL(D_EXTRA) { | 120 | if (BUGLVL(D_EXTRA)) { |
121 | printk("arcnet: ***\n" | 121 | printk("arcnet: ***\n" |
122 | "arcnet: * Read arcnet.txt for important release notes!\n" | 122 | "arcnet: * Read arcnet.txt for important release notes!\n" |
123 | "arcnet: *\n" | 123 | "arcnet: *\n" |
@@ -132,11 +132,11 @@ static int __init arcnet_init(void) | |||
132 | for (count = 0; count < 256; count++) | 132 | for (count = 0; count < 256; count++) |
133 | arc_proto_map[count] = arc_proto_default; | 133 | arc_proto_map[count] = arc_proto_default; |
134 | 134 | ||
135 | BUGLVL(D_DURING) | 135 | if (BUGLVL(D_DURING)) |
136 | printk("arcnet: struct sizes: %Zd %Zd %Zd %Zd %Zd\n", | 136 | printk("arcnet: struct sizes: %Zd %Zd %Zd %Zd %Zd\n", |
137 | sizeof(struct arc_hardware), sizeof(struct arc_rfc1201), | 137 | sizeof(struct arc_hardware), sizeof(struct arc_rfc1201), |
138 | sizeof(struct arc_rfc1051), sizeof(struct arc_eth_encap), | 138 | sizeof(struct arc_rfc1051), sizeof(struct arc_eth_encap), |
139 | sizeof(struct archdr)); | 139 | sizeof(struct archdr)); |
140 | 140 | ||
141 | return 0; | 141 | return 0; |
142 | } | 142 | } |
@@ -235,7 +235,7 @@ static void release_arcbuf(struct net_device *dev, int bufnum) | |||
235 | lp->buf_queue[lp->first_free_buf++] = bufnum; | 235 | lp->buf_queue[lp->first_free_buf++] = bufnum; |
236 | lp->first_free_buf %= 5; | 236 | lp->first_free_buf %= 5; |
237 | 237 | ||
238 | BUGLVL(D_DURING) { | 238 | if (BUGLVL(D_DURING)) { |
239 | BUGMSG(D_DURING, "release_arcbuf: freed #%d; buffer queue is now: ", | 239 | BUGMSG(D_DURING, "release_arcbuf: freed #%d; buffer queue is now: ", |
240 | bufnum); | 240 | bufnum); |
241 | for (i = lp->next_buf; i != lp->first_free_buf; i = (i + 1) % 5) | 241 | 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) | |||
268 | } | 268 | } |
269 | } | 269 | } |
270 | 270 | ||
271 | BUGLVL(D_DURING) { | 271 | if (BUGLVL(D_DURING)) { |
272 | BUGMSG(D_DURING, "get_arcbuf: got #%d; buffer queue is now: ", buf); | 272 | BUGMSG(D_DURING, "get_arcbuf: got #%d; buffer queue is now: ", buf); |
273 | for (i = lp->next_buf; i != lp->first_free_buf; i = (i + 1) % 5) | 273 | for (i = lp->next_buf; i != lp->first_free_buf; i = (i + 1) % 5) |
274 | BUGMSG2(D_DURING, "#%d ", lp->buf_queue[i]); | 274 | BUGMSG2(D_DURING, "#%d ", lp->buf_queue[i]); |
@@ -356,7 +356,7 @@ int arcnet_open(struct net_device *dev) | |||
356 | if (!try_module_get(lp->hw.owner)) | 356 | if (!try_module_get(lp->hw.owner)) |
357 | return -ENODEV; | 357 | return -ENODEV; |
358 | 358 | ||
359 | BUGLVL(D_PROTO) { | 359 | if (BUGLVL(D_PROTO)) { |
360 | BUGMSG(D_PROTO, "protocol map (default is '%c'): ", | 360 | BUGMSG(D_PROTO, "protocol map (default is '%c'): ", |
361 | arc_proto_default->suffix); | 361 | arc_proto_default->suffix); |
362 | for (count = 0; count < 256; count++) | 362 | for (count = 0; count < 256; count++) |
@@ -531,7 +531,8 @@ netdev_tx_t arcnet_send_packet(struct sk_buff *skb, | |||
531 | 531 | ||
532 | BUGMSG(D_SKB_SIZE, "skb: transmitting %d bytes to %02X\n", | 532 | BUGMSG(D_SKB_SIZE, "skb: transmitting %d bytes to %02X\n", |
533 | skb->len, pkt->hard.dest); | 533 | skb->len, pkt->hard.dest); |
534 | BUGLVL(D_SKB) arcnet_dump_skb(dev, skb, "tx"); | 534 | if (BUGLVL(D_SKB)) |
535 | arcnet_dump_skb(dev, skb, "tx"); | ||
535 | 536 | ||
536 | /* fits in one packet? */ | 537 | /* fits in one packet? */ |
537 | if (skb->len - ARC_HDR_SIZE > XMTU && !proto->continue_tx) { | 538 | if (skb->len - ARC_HDR_SIZE > XMTU && !proto->continue_tx) { |
@@ -609,7 +610,8 @@ static int go_tx(struct net_device *dev) | |||
609 | if (lp->cur_tx != -1 || lp->next_tx == -1) | 610 | if (lp->cur_tx != -1 || lp->next_tx == -1) |
610 | return 0; | 611 | return 0; |
611 | 612 | ||
612 | BUGLVL(D_TX) arcnet_dump_packet(dev, lp->next_tx, "go_tx", 0); | 613 | if (BUGLVL(D_TX)) |
614 | arcnet_dump_packet(dev, lp->next_tx, "go_tx", 0); | ||
613 | 615 | ||
614 | lp->cur_tx = lp->next_tx; | 616 | lp->cur_tx = lp->next_tx; |
615 | lp->next_tx = -1; | 617 | lp->next_tx = -1; |
@@ -822,7 +824,8 @@ irqreturn_t arcnet_interrupt(int irq, void *dev_id) | |||
822 | } | 824 | } |
823 | /* now process the received packet, if any */ | 825 | /* now process the received packet, if any */ |
824 | if (recbuf != -1) { | 826 | if (recbuf != -1) { |
825 | BUGLVL(D_RX) arcnet_dump_packet(dev, recbuf, "rx irq", 0); | 827 | if (BUGLVL(D_RX)) |
828 | arcnet_dump_packet(dev, recbuf, "rx irq", 0); | ||
826 | 829 | ||
827 | arcnet_rx(dev, recbuf); | 830 | arcnet_rx(dev, recbuf); |
828 | release_arcbuf(dev, recbuf); | 831 | release_arcbuf(dev, recbuf); |
@@ -938,7 +941,7 @@ static void arcnet_rx(struct net_device *dev, int bufnum) | |||
938 | 941 | ||
939 | /* call the right receiver for the protocol */ | 942 | /* call the right receiver for the protocol */ |
940 | if (arc_proto_map[soft->proto]->is_ip) { | 943 | if (arc_proto_map[soft->proto]->is_ip) { |
941 | BUGLVL(D_PROTO) { | 944 | if (BUGLVL(D_PROTO)) { |
942 | struct ArcProto | 945 | struct ArcProto |
943 | *oldp = arc_proto_map[lp->default_proto[pkt.hard.source]], | 946 | *oldp = arc_proto_map[lp->default_proto[pkt.hard.source]], |
944 | *newp = arc_proto_map[soft->proto]; | 947 | *newp = arc_proto_map[soft->proto]; |
diff --git a/drivers/net/arcnet/capmode.c b/drivers/net/arcnet/capmode.c index 8391324f684b..e7ec907f4680 100644 --- a/drivers/net/arcnet/capmode.c +++ b/drivers/net/arcnet/capmode.c | |||
@@ -84,7 +84,8 @@ static void rx(struct net_device *dev, int bufnum, | |||
84 | + sizeof(int), | 84 | + sizeof(int), |
85 | length - sizeof(pkt->soft)); | 85 | length - sizeof(pkt->soft)); |
86 | 86 | ||
87 | BUGLVL(D_SKB) arcnet_dump_skb(dev, skb, "rx"); | 87 | if (BUGLVL(D_SKB)) |
88 | arcnet_dump_skb(dev, skb, "rx"); | ||
88 | 89 | ||
89 | skb->protocol = cpu_to_be16(ETH_P_ARCNET); | 90 | skb->protocol = cpu_to_be16(ETH_P_ARCNET); |
90 | netif_rx(skb); | 91 | netif_rx(skb); |
@@ -190,7 +191,8 @@ static int ack_tx(struct net_device *dev, int acked) | |||
190 | BUGMSG(D_DURING, "capmode: ack_tx: protocol: %x: result: %d\n", | 191 | BUGMSG(D_DURING, "capmode: ack_tx: protocol: %x: result: %d\n", |
191 | lp->outgoing.skb->protocol, acked); | 192 | lp->outgoing.skb->protocol, acked); |
192 | 193 | ||
193 | BUGLVL(D_SKB) arcnet_dump_skb(dev, lp->outgoing.skb, "ack_tx"); | 194 | if (BUGLVL(D_SKB)) |
195 | arcnet_dump_skb(dev, lp->outgoing.skb, "ack_tx"); | ||
194 | 196 | ||
195 | /* Now alloc a skb to send back up through the layers: */ | 197 | /* Now alloc a skb to send back up through the layers: */ |
196 | ackskb = alloc_skb(length + ARC_HDR_SIZE, GFP_ATOMIC); | 198 | ackskb = alloc_skb(length + ARC_HDR_SIZE, GFP_ATOMIC); |
@@ -216,7 +218,8 @@ static int ack_tx(struct net_device *dev, int acked) | |||
216 | 218 | ||
217 | ackskb->protocol = cpu_to_be16(ETH_P_ARCNET); | 219 | ackskb->protocol = cpu_to_be16(ETH_P_ARCNET); |
218 | 220 | ||
219 | BUGLVL(D_SKB) arcnet_dump_skb(dev, ackskb, "ack_tx_recv"); | 221 | if (BUGLVL(D_SKB)) |
222 | arcnet_dump_skb(dev, ackskb, "ack_tx_recv"); | ||
220 | netif_rx(ackskb); | 223 | netif_rx(ackskb); |
221 | 224 | ||
222 | free_outskb: | 225 | free_outskb: |
diff --git a/drivers/net/arcnet/com20020-isa.c b/drivers/net/arcnet/com20020-isa.c index 6e38a19d7210..af87c7482478 100644 --- a/drivers/net/arcnet/com20020-isa.c +++ b/drivers/net/arcnet/com20020-isa.c | |||
@@ -53,7 +53,8 @@ static int __init com20020isa_probe(struct net_device *dev) | |||
53 | struct arcnet_local *lp = netdev_priv(dev); | 53 | struct arcnet_local *lp = netdev_priv(dev); |
54 | int err; | 54 | int err; |
55 | 55 | ||
56 | BUGLVL(D_NORMAL) printk(VERSION); | 56 | if (BUGLVL(D_NORMAL)) |
57 | printk(VERSION); | ||
57 | 58 | ||
58 | ioaddr = dev->base_addr; | 59 | ioaddr = dev->base_addr; |
59 | if (!ioaddr) { | 60 | if (!ioaddr) { |
diff --git a/drivers/net/arcnet/com20020-pci.c b/drivers/net/arcnet/com20020-pci.c index 72334b59aa26..c8184de4480d 100644 --- a/drivers/net/arcnet/com20020-pci.c +++ b/drivers/net/arcnet/com20020-pci.c | |||
@@ -402,7 +402,8 @@ static struct pci_driver com20020pci_driver = { | |||
402 | 402 | ||
403 | static int __init com20020pci_init(void) | 403 | static int __init com20020pci_init(void) |
404 | { | 404 | { |
405 | BUGLVL(D_NORMAL) printk(VERSION); | 405 | if (BUGLVL(D_NORMAL)) |
406 | printk(VERSION); | ||
406 | return pci_register_driver(&com20020pci_driver); | 407 | return pci_register_driver(&com20020pci_driver); |
407 | } | 408 | } |
408 | 409 | ||
diff --git a/drivers/net/arcnet/com20020.c b/drivers/net/arcnet/com20020.c index 63697272f146..3170e8ebb7fa 100644 --- a/drivers/net/arcnet/com20020.c +++ b/drivers/net/arcnet/com20020.c | |||
@@ -365,7 +365,8 @@ MODULE_LICENSE("GPL"); | |||
365 | 365 | ||
366 | static int __init com20020_module_init(void) | 366 | static int __init com20020_module_init(void) |
367 | { | 367 | { |
368 | BUGLVL(D_NORMAL) printk(VERSION); | 368 | if (BUGLVL(D_NORMAL)) |
369 | printk(VERSION); | ||
369 | return 0; | 370 | return 0; |
370 | } | 371 | } |
371 | 372 | ||
diff --git a/drivers/net/arcnet/com90io.c b/drivers/net/arcnet/com90io.c index 6ec36f9975ba..33a8531e90c7 100644 --- a/drivers/net/arcnet/com90io.c +++ b/drivers/net/arcnet/com90io.c | |||
@@ -145,8 +145,10 @@ static int __init com90io_probe(struct net_device *dev) | |||
145 | int ioaddr = dev->base_addr, status; | 145 | int ioaddr = dev->base_addr, status; |
146 | unsigned long airqmask; | 146 | unsigned long airqmask; |
147 | 147 | ||
148 | BUGLVL(D_NORMAL) printk(VERSION); | 148 | if (BUGLVL(D_NORMAL)) { |
149 | BUGLVL(D_NORMAL) printk("E-mail me if you actually test this driver, please!\n"); | 149 | printk(VERSION); |
150 | printk("E-mail me if you actually test this driver, please!\n"); | ||
151 | } | ||
150 | 152 | ||
151 | if (!ioaddr) { | 153 | if (!ioaddr) { |
152 | BUGMSG(D_NORMAL, "No autoprobe for IO mapped cards; you must specify the base address!\n"); | 154 | BUGMSG(D_NORMAL, "No autoprobe for IO mapped cards; you must specify the base address!\n"); |
diff --git a/drivers/net/arcnet/com90xx.c b/drivers/net/arcnet/com90xx.c index 4781cd696dd1..b5e1c1904f13 100644 --- a/drivers/net/arcnet/com90xx.c +++ b/drivers/net/arcnet/com90xx.c | |||
@@ -133,7 +133,8 @@ static void __init com90xx_probe(void) | |||
133 | return; | 133 | return; |
134 | } | 134 | } |
135 | 135 | ||
136 | BUGLVL(D_NORMAL) printk(VERSION); | 136 | if (BUGLVL(D_NORMAL)) |
137 | printk(VERSION); | ||
137 | 138 | ||
138 | /* set up the arrays where we'll store the possible probe addresses */ | 139 | /* set up the arrays where we'll store the possible probe addresses */ |
139 | numports = numshmems = 0; | 140 | numports = numshmems = 0; |
@@ -166,14 +167,16 @@ static void __init com90xx_probe(void) | |||
166 | if (!request_region(*port, ARCNET_TOTAL_SIZE, "arcnet (90xx)")) { | 167 | if (!request_region(*port, ARCNET_TOTAL_SIZE, "arcnet (90xx)")) { |
167 | BUGMSG2(D_INIT_REASONS, "(request_region)\n"); | 168 | BUGMSG2(D_INIT_REASONS, "(request_region)\n"); |
168 | BUGMSG2(D_INIT_REASONS, "S1: "); | 169 | BUGMSG2(D_INIT_REASONS, "S1: "); |
169 | BUGLVL(D_INIT_REASONS) numprint = 0; | 170 | if (BUGLVL(D_INIT_REASONS)) |
171 | numprint = 0; | ||
170 | *port-- = ports[--numports]; | 172 | *port-- = ports[--numports]; |
171 | continue; | 173 | continue; |
172 | } | 174 | } |
173 | if (ASTATUS() == 0xFF) { | 175 | if (ASTATUS() == 0xFF) { |
174 | BUGMSG2(D_INIT_REASONS, "(empty)\n"); | 176 | BUGMSG2(D_INIT_REASONS, "(empty)\n"); |
175 | BUGMSG2(D_INIT_REASONS, "S1: "); | 177 | BUGMSG2(D_INIT_REASONS, "S1: "); |
176 | BUGLVL(D_INIT_REASONS) numprint = 0; | 178 | if (BUGLVL(D_INIT_REASONS)) |
179 | numprint = 0; | ||
177 | release_region(*port, ARCNET_TOTAL_SIZE); | 180 | release_region(*port, ARCNET_TOTAL_SIZE); |
178 | *port-- = ports[--numports]; | 181 | *port-- = ports[--numports]; |
179 | continue; | 182 | continue; |
@@ -182,7 +185,8 @@ static void __init com90xx_probe(void) | |||
182 | 185 | ||
183 | BUGMSG2(D_INIT_REASONS, "\n"); | 186 | BUGMSG2(D_INIT_REASONS, "\n"); |
184 | BUGMSG2(D_INIT_REASONS, "S1: "); | 187 | BUGMSG2(D_INIT_REASONS, "S1: "); |
185 | BUGLVL(D_INIT_REASONS) numprint = 0; | 188 | if (BUGLVL(D_INIT_REASONS)) |
189 | numprint = 0; | ||
186 | } | 190 | } |
187 | BUGMSG2(D_INIT, "\n"); | 191 | BUGMSG2(D_INIT, "\n"); |
188 | 192 | ||
@@ -227,21 +231,24 @@ static void __init com90xx_probe(void) | |||
227 | if (!request_mem_region(*p, MIRROR_SIZE, "arcnet (90xx)")) { | 231 | if (!request_mem_region(*p, MIRROR_SIZE, "arcnet (90xx)")) { |
228 | BUGMSG2(D_INIT_REASONS, "(request_mem_region)\n"); | 232 | BUGMSG2(D_INIT_REASONS, "(request_mem_region)\n"); |
229 | BUGMSG2(D_INIT_REASONS, "Stage 3: "); | 233 | BUGMSG2(D_INIT_REASONS, "Stage 3: "); |
230 | BUGLVL(D_INIT_REASONS) numprint = 0; | 234 | if (BUGLVL(D_INIT_REASONS)) |
235 | numprint = 0; | ||
231 | goto out; | 236 | goto out; |
232 | } | 237 | } |
233 | base = ioremap(*p, MIRROR_SIZE); | 238 | base = ioremap(*p, MIRROR_SIZE); |
234 | if (!base) { | 239 | if (!base) { |
235 | BUGMSG2(D_INIT_REASONS, "(ioremap)\n"); | 240 | BUGMSG2(D_INIT_REASONS, "(ioremap)\n"); |
236 | BUGMSG2(D_INIT_REASONS, "Stage 3: "); | 241 | BUGMSG2(D_INIT_REASONS, "Stage 3: "); |
237 | BUGLVL(D_INIT_REASONS) numprint = 0; | 242 | if (BUGLVL(D_INIT_REASONS)) |
243 | numprint = 0; | ||
238 | goto out1; | 244 | goto out1; |
239 | } | 245 | } |
240 | if (readb(base) != TESTvalue) { | 246 | if (readb(base) != TESTvalue) { |
241 | BUGMSG2(D_INIT_REASONS, "(%02Xh != %02Xh)\n", | 247 | BUGMSG2(D_INIT_REASONS, "(%02Xh != %02Xh)\n", |
242 | readb(base), TESTvalue); | 248 | readb(base), TESTvalue); |
243 | BUGMSG2(D_INIT_REASONS, "S3: "); | 249 | BUGMSG2(D_INIT_REASONS, "S3: "); |
244 | BUGLVL(D_INIT_REASONS) numprint = 0; | 250 | if (BUGLVL(D_INIT_REASONS)) |
251 | numprint = 0; | ||
245 | goto out2; | 252 | goto out2; |
246 | } | 253 | } |
247 | /* By writing 0x42 to the TESTvalue location, we also make | 254 | /* By writing 0x42 to the TESTvalue location, we also make |
@@ -257,7 +264,8 @@ static void __init com90xx_probe(void) | |||
257 | } | 264 | } |
258 | BUGMSG2(D_INIT_REASONS, "\n"); | 265 | BUGMSG2(D_INIT_REASONS, "\n"); |
259 | BUGMSG2(D_INIT_REASONS, "S3: "); | 266 | BUGMSG2(D_INIT_REASONS, "S3: "); |
260 | BUGLVL(D_INIT_REASONS) numprint = 0; | 267 | if (BUGLVL(D_INIT_REASONS)) |
268 | numprint = 0; | ||
261 | iomem[index] = base; | 269 | iomem[index] = base; |
262 | continue; | 270 | continue; |
263 | out2: | 271 | out2: |
@@ -319,7 +327,8 @@ static void __init com90xx_probe(void) | |||
319 | != (NORXflag | RECONflag | TXFREEflag | RESETflag)) { | 327 | != (NORXflag | RECONflag | TXFREEflag | RESETflag)) { |
320 | BUGMSG2(D_INIT_REASONS, "(status=%Xh)\n", status); | 328 | BUGMSG2(D_INIT_REASONS, "(status=%Xh)\n", status); |
321 | BUGMSG2(D_INIT_REASONS, "S5: "); | 329 | BUGMSG2(D_INIT_REASONS, "S5: "); |
322 | BUGLVL(D_INIT_REASONS) numprint = 0; | 330 | if (BUGLVL(D_INIT_REASONS)) |
331 | numprint = 0; | ||
323 | release_region(*port, ARCNET_TOTAL_SIZE); | 332 | release_region(*port, ARCNET_TOTAL_SIZE); |
324 | *port-- = ports[--numports]; | 333 | *port-- = ports[--numports]; |
325 | continue; | 334 | continue; |
@@ -330,7 +339,8 @@ static void __init com90xx_probe(void) | |||
330 | BUGMSG2(D_INIT_REASONS, " (eternal reset, status=%Xh)\n", | 339 | BUGMSG2(D_INIT_REASONS, " (eternal reset, status=%Xh)\n", |
331 | status); | 340 | status); |
332 | BUGMSG2(D_INIT_REASONS, "S5: "); | 341 | BUGMSG2(D_INIT_REASONS, "S5: "); |
333 | BUGLVL(D_INIT_REASONS) numprint = 0; | 342 | if (BUGLVL(D_INIT_REASONS)) |
343 | numprint = 0; | ||
334 | release_region(*port, ARCNET_TOTAL_SIZE); | 344 | release_region(*port, ARCNET_TOTAL_SIZE); |
335 | *port-- = ports[--numports]; | 345 | *port-- = ports[--numports]; |
336 | continue; | 346 | continue; |
@@ -352,7 +362,8 @@ static void __init com90xx_probe(void) | |||
352 | if (airq <= 0) { | 362 | if (airq <= 0) { |
353 | BUGMSG2(D_INIT_REASONS, "(airq=%d)\n", airq); | 363 | BUGMSG2(D_INIT_REASONS, "(airq=%d)\n", airq); |
354 | BUGMSG2(D_INIT_REASONS, "S5: "); | 364 | BUGMSG2(D_INIT_REASONS, "S5: "); |
355 | BUGLVL(D_INIT_REASONS) numprint = 0; | 365 | if (BUGLVL(D_INIT_REASONS)) |
366 | numprint = 0; | ||
356 | release_region(*port, ARCNET_TOTAL_SIZE); | 367 | release_region(*port, ARCNET_TOTAL_SIZE); |
357 | *port-- = ports[--numports]; | 368 | *port-- = ports[--numports]; |
358 | continue; | 369 | continue; |
@@ -406,16 +417,20 @@ static void __init com90xx_probe(void) | |||
406 | } | 417 | } |
407 | 418 | ||
408 | if (openparen) { | 419 | if (openparen) { |
409 | BUGLVL(D_INIT) printk("no matching shmem)\n"); | 420 | if (BUGLVL(D_INIT)) |
410 | BUGLVL(D_INIT_REASONS) printk("S5: "); | 421 | printk("no matching shmem)\n"); |
411 | BUGLVL(D_INIT_REASONS) numprint = 0; | 422 | if (BUGLVL(D_INIT_REASONS)) { |
423 | printk("S5: "); | ||
424 | numprint = 0; | ||
425 | } | ||
412 | } | 426 | } |
413 | if (!found) | 427 | if (!found) |
414 | release_region(*port, ARCNET_TOTAL_SIZE); | 428 | release_region(*port, ARCNET_TOTAL_SIZE); |
415 | *port-- = ports[--numports]; | 429 | *port-- = ports[--numports]; |
416 | } | 430 | } |
417 | 431 | ||
418 | BUGLVL(D_INIT_REASONS) printk("\n"); | 432 | if (BUGLVL(D_INIT_REASONS)) |
433 | printk("\n"); | ||
419 | 434 | ||
420 | /* Now put back TESTvalue on all leftover shmems. */ | 435 | /* Now put back TESTvalue on all leftover shmems. */ |
421 | for (index = 0; index < numshmems; index++) { | 436 | for (index = 0; index < numshmems; index++) { |
@@ -603,8 +618,8 @@ static int com90xx_reset(struct net_device *dev, int really_reset) | |||
603 | ACOMMAND(CONFIGcmd | EXTconf); | 618 | ACOMMAND(CONFIGcmd | EXTconf); |
604 | 619 | ||
605 | /* clean out all the memory to make debugging make more sense :) */ | 620 | /* clean out all the memory to make debugging make more sense :) */ |
606 | BUGLVL(D_DURING) | 621 | if (BUGLVL(D_DURING)) |
607 | memset_io(lp->mem_start, 0x42, 2048); | 622 | memset_io(lp->mem_start, 0x42, 2048); |
608 | 623 | ||
609 | /* done! return success. */ | 624 | /* done! return success. */ |
610 | return 0; | 625 | return 0; |
diff --git a/drivers/net/arcnet/rfc1051.c b/drivers/net/arcnet/rfc1051.c index e78b76535acc..824d71fcfd53 100644 --- a/drivers/net/arcnet/rfc1051.c +++ b/drivers/net/arcnet/rfc1051.c | |||
@@ -149,7 +149,8 @@ static void rx(struct net_device *dev, int bufnum, | |||
149 | pkt->soft.raw + sizeof(pkt->soft), | 149 | pkt->soft.raw + sizeof(pkt->soft), |
150 | length - sizeof(pkt->soft)); | 150 | length - sizeof(pkt->soft)); |
151 | 151 | ||
152 | BUGLVL(D_SKB) arcnet_dump_skb(dev, skb, "rx"); | 152 | if (BUGLVL(D_SKB)) |
153 | arcnet_dump_skb(dev, skb, "rx"); | ||
153 | 154 | ||
154 | skb->protocol = type_trans(skb, dev); | 155 | skb->protocol = type_trans(skb, dev); |
155 | netif_rx(skb); | 156 | netif_rx(skb); |
diff --git a/drivers/net/arcnet/rfc1201.c b/drivers/net/arcnet/rfc1201.c index 4ebfbcbe5de3..d052976ebdfa 100644 --- a/drivers/net/arcnet/rfc1201.c +++ b/drivers/net/arcnet/rfc1201.c | |||
@@ -221,7 +221,8 @@ static void rx(struct net_device *dev, int bufnum, | |||
221 | dev->stats.rx_crc_errors++; | 221 | dev->stats.rx_crc_errors++; |
222 | } | 222 | } |
223 | } | 223 | } |
224 | BUGLVL(D_SKB) arcnet_dump_skb(dev, skb, "rx"); | 224 | if (BUGLVL(D_SKB)) |
225 | arcnet_dump_skb(dev, skb, "rx"); | ||
225 | 226 | ||
226 | skb->protocol = type_trans(skb, dev); | 227 | skb->protocol = type_trans(skb, dev); |
227 | netif_rx(skb); | 228 | netif_rx(skb); |
@@ -353,7 +354,8 @@ static void rx(struct net_device *dev, int bufnum, | |||
353 | skb->len, pkt->hard.source); | 354 | skb->len, pkt->hard.source); |
354 | BUGMSG(D_SKB_SIZE, "skb: received %d bytes from %02X (split)\n", | 355 | BUGMSG(D_SKB_SIZE, "skb: received %d bytes from %02X (split)\n", |
355 | skb->len, pkt->hard.source); | 356 | skb->len, pkt->hard.source); |
356 | BUGLVL(D_SKB) arcnet_dump_skb(dev, skb, "rx"); | 357 | if (BUGLVL(D_SKB)) |
358 | arcnet_dump_skb(dev, skb, "rx"); | ||
357 | 359 | ||
358 | skb->protocol = type_trans(skb, dev); | 360 | skb->protocol = type_trans(skb, dev); |
359 | netif_rx(skb); | 361 | netif_rx(skb); |
diff --git a/include/linux/arcdevice.h b/include/linux/arcdevice.h index ad610208fbba..f07c66383b88 100644 --- a/include/linux/arcdevice.h +++ b/include/linux/arcdevice.h | |||
@@ -78,13 +78,12 @@ | |||
78 | #endif | 78 | #endif |
79 | extern int arcnet_debug; | 79 | extern int arcnet_debug; |
80 | 80 | ||
81 | #define BUGLVL_TEST(x) ((x) & ARCNET_DEBUG_MAX & arcnet_debug) | 81 | #define BUGLVL(x) ((x) & ARCNET_DEBUG_MAX & arcnet_debug) |
82 | #define BUGLVL(x) if (BUGLVL_TEST(x)) | ||
83 | 82 | ||
84 | /* macros to simplify debug checking */ | 83 | /* macros to simplify debug checking */ |
85 | #define BUGMSG(x, fmt, ...) \ | 84 | #define BUGMSG(x, fmt, ...) \ |
86 | do { \ | 85 | do { \ |
87 | if (BUGLVL_TEST(x)) \ | 86 | if (BUGLVL(x)) \ |
88 | printk("%s%6s: " fmt, \ | 87 | printk("%s%6s: " fmt, \ |
89 | (x) == D_NORMAL ? KERN_WARNING : \ | 88 | (x) == D_NORMAL ? KERN_WARNING : \ |
90 | (x) < D_DURING ? KERN_INFO : KERN_DEBUG, \ | 89 | (x) < D_DURING ? KERN_INFO : KERN_DEBUG, \ |
@@ -93,12 +92,14 @@ do { \ | |||
93 | 92 | ||
94 | #define BUGMSG2(x, fmt, ...) \ | 93 | #define BUGMSG2(x, fmt, ...) \ |
95 | do { \ | 94 | do { \ |
96 | if (BUGLVL_TEST(x)) \ | 95 | if (BUGLVL(x)) \ |
97 | printk(fmt, ##__VA_ARGS__); \ | 96 | printk(fmt, ##__VA_ARGS__); \ |
98 | } while (0) | 97 | } while (0) |
99 | 98 | ||
100 | /* see how long a function call takes to run, expressed in CPU cycles */ | 99 | /* see how long a function call takes to run, expressed in CPU cycles */ |
101 | #define TIME(name, bytes, call) BUGLVL(D_TIMING) { \ | 100 | #define TIME(name, bytes, call) \ |
101 | do { \ | ||
102 | if (BUGLVL(D_TIMING)) { \ | ||
102 | unsigned long _x, _y; \ | 103 | unsigned long _x, _y; \ |
103 | _x = get_cycles(); \ | 104 | _x = get_cycles(); \ |
104 | call; \ | 105 | call; \ |
@@ -108,10 +109,10 @@ do { \ | |||
108 | "%lu Kbytes/100Mcycle\n", \ | 109 | "%lu Kbytes/100Mcycle\n", \ |
109 | name, bytes, _y - _x, \ | 110 | name, bytes, _y - _x, \ |
110 | 100000000 / 1024 * bytes / (_y - _x + 1)); \ | 111 | 100000000 / 1024 * bytes / (_y - _x + 1)); \ |
111 | } \ | 112 | } else { \ |
112 | else { \ | ||
113 | call; \ | 113 | call; \ |
114 | } | 114 | } \ |
115 | } while (0) | ||
115 | 116 | ||
116 | /* | 117 | /* |
117 | * Time needed to reset the card - in ms (milliseconds). This works on my | 118 | * Time needed to reset the card - in ms (milliseconds). This works on my |