diff options
author | Joe Perches <joe@perches.com> | 2015-05-05 13:05:55 -0400 |
---|---|---|
committer | Michael Grzeschik <m.grzeschik@pengutronix.de> | 2015-09-23 02:44:24 -0400 |
commit | a34c0932c3b2f28542825ffc5280d562c49ad42d (patch) | |
tree | 2fd465fe1c93b7ea866af66847c7167f81bff47a /drivers/net/arcnet/capmode.c | |
parent | 72aeea4841c037b9b3abf65859673cbd7b6664a9 (diff) |
arcnet: Convert BUGMSG and BUGMSG2 to arc_prink and arc_cont
These macros don't actually represent BUG uses but are more commonly
used as logging macros, so use a more kernel style macro.
Convert the BUGMSG from a netdev_ like use to actually use netdev_<level>.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Diffstat (limited to 'drivers/net/arcnet/capmode.c')
-rw-r--r-- | drivers/net/arcnet/capmode.c | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/drivers/net/arcnet/capmode.c b/drivers/net/arcnet/capmode.c index e7ec907f4680..d62d1accf4b6 100644 --- a/drivers/net/arcnet/capmode.c +++ b/drivers/net/arcnet/capmode.c | |||
@@ -47,7 +47,8 @@ static void rx(struct net_device *dev, int bufnum, | |||
47 | char *pktbuf, *pkthdrbuf; | 47 | char *pktbuf, *pkthdrbuf; |
48 | int ofs; | 48 | int ofs; |
49 | 49 | ||
50 | BUGMSG(D_DURING, "it's a raw(cap) packet (length=%d)\n", length); | 50 | arc_printk(D_DURING, dev, "it's a raw(cap) packet (length=%d)\n", |
51 | length); | ||
51 | 52 | ||
52 | if (length >= MinTU) | 53 | if (length >= MinTU) |
53 | ofs = 512 - length; | 54 | ofs = 512 - length; |
@@ -56,7 +57,7 @@ static void rx(struct net_device *dev, int bufnum, | |||
56 | 57 | ||
57 | skb = alloc_skb(length + ARC_HDR_SIZE + sizeof(int), GFP_ATOMIC); | 58 | skb = alloc_skb(length + ARC_HDR_SIZE + sizeof(int), GFP_ATOMIC); |
58 | if (skb == NULL) { | 59 | if (skb == NULL) { |
59 | BUGMSG(D_NORMAL, "Memory squeeze, dropping packet.\n"); | 60 | arc_printk(D_NORMAL, dev, "Memory squeeze, dropping packet\n"); |
60 | dev->stats.rx_dropped++; | 61 | dev->stats.rx_dropped++; |
61 | return; | 62 | return; |
62 | } | 63 | } |
@@ -102,8 +103,8 @@ static int build_header(struct sk_buff *skb, | |||
102 | int hdr_size = ARC_HDR_SIZE; | 103 | int hdr_size = ARC_HDR_SIZE; |
103 | struct archdr *pkt = (struct archdr *)skb_push(skb, hdr_size); | 104 | struct archdr *pkt = (struct archdr *)skb_push(skb, hdr_size); |
104 | 105 | ||
105 | BUGMSG(D_PROTO, "Preparing header for cap packet %x.\n", | 106 | arc_printk(D_PROTO, dev, "Preparing header for cap packet %x.\n", |
106 | *((int *)&pkt->soft.cap.cookie[0])); | 107 | *((int *)&pkt->soft.cap.cookie[0])); |
107 | 108 | ||
108 | /* Set the source hardware address. | 109 | /* Set the source hardware address. |
109 | * | 110 | * |
@@ -140,16 +141,16 @@ static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length, | |||
140 | /* And neither is the cookie field */ | 141 | /* And neither is the cookie field */ |
141 | length -= sizeof(int); | 142 | length -= sizeof(int); |
142 | 143 | ||
143 | BUGMSG(D_DURING, "prepare_tx: txbufs=%d/%d/%d\n", | 144 | arc_printk(D_DURING, dev, "prepare_tx: txbufs=%d/%d/%d\n", |
144 | lp->next_tx, lp->cur_tx, bufnum); | 145 | lp->next_tx, lp->cur_tx, bufnum); |
145 | 146 | ||
146 | BUGMSG(D_PROTO, "Sending for cap packet %x.\n", | 147 | arc_printk(D_PROTO, dev, "Sending for cap packet %x.\n", |
147 | *((int *)&pkt->soft.cap.cookie[0])); | 148 | *((int *)&pkt->soft.cap.cookie[0])); |
148 | 149 | ||
149 | if (length > XMTU) { | 150 | if (length > XMTU) { |
150 | /* should never happen! other people already check for this. */ | 151 | /* should never happen! other people already check for this. */ |
151 | BUGMSG(D_NORMAL, "Bug! prepare_tx with size %d (> %d)\n", | 152 | arc_printk(D_NORMAL, dev, "Bug! prepare_tx with size %d (> %d)\n", |
152 | length, XMTU); | 153 | length, XMTU); |
153 | length = XMTU; | 154 | length = XMTU; |
154 | } | 155 | } |
155 | if (length > MinTU) { | 156 | if (length > MinTU) { |
@@ -162,8 +163,8 @@ static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length, | |||
162 | hard->offset[0] = ofs = 256 - length; | 163 | hard->offset[0] = ofs = 256 - length; |
163 | } | 164 | } |
164 | 165 | ||
165 | BUGMSG(D_DURING, "prepare_tx: length=%d ofs=%d\n", | 166 | arc_printk(D_DURING, dev, "prepare_tx: length=%d ofs=%d\n", |
166 | length, ofs); | 167 | length, ofs); |
167 | 168 | ||
168 | /* Copy the arcnet-header + the protocol byte down: */ | 169 | /* Copy the arcnet-header + the protocol byte down: */ |
169 | lp->hw.copy_to_card(dev, bufnum, 0, hard, ARC_HDR_SIZE); | 170 | lp->hw.copy_to_card(dev, bufnum, 0, hard, ARC_HDR_SIZE); |
@@ -188,8 +189,8 @@ static int ack_tx(struct net_device *dev, int acked) | |||
188 | struct archdr *ackpkt; | 189 | struct archdr *ackpkt; |
189 | int length = sizeof(struct arc_cap); | 190 | int length = sizeof(struct arc_cap); |
190 | 191 | ||
191 | BUGMSG(D_DURING, "capmode: ack_tx: protocol: %x: result: %d\n", | 192 | arc_printk(D_DURING, dev, "capmode: ack_tx: protocol: %x: result: %d\n", |
192 | lp->outgoing.skb->protocol, acked); | 193 | lp->outgoing.skb->protocol, acked); |
193 | 194 | ||
194 | if (BUGLVL(D_SKB)) | 195 | if (BUGLVL(D_SKB)) |
195 | arcnet_dump_skb(dev, lp->outgoing.skb, "ack_tx"); | 196 | arcnet_dump_skb(dev, lp->outgoing.skb, "ack_tx"); |
@@ -197,7 +198,7 @@ static int ack_tx(struct net_device *dev, int acked) | |||
197 | /* Now alloc a skb to send back up through the layers: */ | 198 | /* Now alloc a skb to send back up through the layers: */ |
198 | ackskb = alloc_skb(length + ARC_HDR_SIZE, GFP_ATOMIC); | 199 | ackskb = alloc_skb(length + ARC_HDR_SIZE, GFP_ATOMIC); |
199 | if (ackskb == NULL) { | 200 | if (ackskb == NULL) { |
200 | BUGMSG(D_NORMAL, "Memory squeeze, can't acknowledge.\n"); | 201 | arc_printk(D_NORMAL, dev, "Memory squeeze, can't acknowledge\n"); |
201 | goto free_outskb; | 202 | goto free_outskb; |
202 | } | 203 | } |
203 | 204 | ||
@@ -213,8 +214,8 @@ static int ack_tx(struct net_device *dev, int acked) | |||
213 | ackpkt->soft.cap.proto = 0; /* using protocol 0 for acknowledge */ | 214 | ackpkt->soft.cap.proto = 0; /* using protocol 0 for acknowledge */ |
214 | ackpkt->soft.cap.mes.ack = acked; | 215 | ackpkt->soft.cap.mes.ack = acked; |
215 | 216 | ||
216 | BUGMSG(D_PROTO, "Ackknowledge for cap packet %x.\n", | 217 | arc_printk(D_PROTO, dev, "Ackknowledge for cap packet %x.\n", |
217 | *((int *)&ackpkt->soft.cap.cookie[0])); | 218 | *((int *)&ackpkt->soft.cap.cookie[0])); |
218 | 219 | ||
219 | ackskb->protocol = cpu_to_be16(ETH_P_ARCNET); | 220 | ackskb->protocol = cpu_to_be16(ETH_P_ARCNET); |
220 | 221 | ||