aboutsummaryrefslogtreecommitdiffstats
path: root/net/atm/pppoatm.c
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@linux-foundation.org>2007-08-28 18:22:09 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:48:27 -0400
commit522400623e240ad134cb4101b1fddc3245d2a7ed (patch)
treefb1f341426ae7cd5c977232c8084bf45819d1bea /net/atm/pppoatm.c
parent23f1f4eff85d3d2ec9ed589e3fdcbba59eaa083e (diff)
[ATM]: Replace DPRINTK() with pr_debug().
Get rid of using DPRINTK macro in ATM and use pr_debug (in kernel.h). Using the standard macro is cleaner and forces code to check for bad arguments and formatting. Fixes from Thomas Graf. Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/atm/pppoatm.c')
-rw-r--r--net/atm/pppoatm.c23
1 files changed, 6 insertions, 17 deletions
diff --git a/net/atm/pppoatm.c b/net/atm/pppoatm.c
index 19d5dfc0702f..0af84cd4f65b 100644
--- a/net/atm/pppoatm.c
+++ b/net/atm/pppoatm.c
@@ -46,13 +46,6 @@
46 46
47#include "common.h" 47#include "common.h"
48 48
49#if 0
50#define DPRINTK(format, args...) \
51 printk(KERN_DEBUG "pppoatm: " format, ##args)
52#else
53#define DPRINTK(format, args...)
54#endif
55
56enum pppoatm_encaps { 49enum pppoatm_encaps {
57 e_autodetect = PPPOATM_ENCAPS_AUTODETECT, 50 e_autodetect = PPPOATM_ENCAPS_AUTODETECT,
58 e_vc = PPPOATM_ENCAPS_VC, 51 e_vc = PPPOATM_ENCAPS_VC,
@@ -139,9 +132,9 @@ static void pppoatm_unassign_vcc(struct atm_vcc *atmvcc)
139static void pppoatm_push(struct atm_vcc *atmvcc, struct sk_buff *skb) 132static void pppoatm_push(struct atm_vcc *atmvcc, struct sk_buff *skb)
140{ 133{
141 struct pppoatm_vcc *pvcc = atmvcc_to_pvcc(atmvcc); 134 struct pppoatm_vcc *pvcc = atmvcc_to_pvcc(atmvcc);
142 DPRINTK("pppoatm push\n"); 135 pr_debug("pppoatm push\n");
143 if (skb == NULL) { /* VCC was closed */ 136 if (skb == NULL) { /* VCC was closed */
144 DPRINTK("removing ATMPPP VCC %p\n", pvcc); 137 pr_debug("removing ATMPPP VCC %p\n", pvcc);
145 pppoatm_unassign_vcc(atmvcc); 138 pppoatm_unassign_vcc(atmvcc);
146 atmvcc->push(atmvcc, NULL); /* Pass along bad news */ 139 atmvcc->push(atmvcc, NULL); /* Pass along bad news */
147 return; 140 return;
@@ -172,9 +165,8 @@ static void pppoatm_push(struct atm_vcc *atmvcc, struct sk_buff *skb)
172 pvcc->chan.mtu += LLC_LEN; 165 pvcc->chan.mtu += LLC_LEN;
173 break; 166 break;
174 } 167 }
175 DPRINTK("(unit %d): Couldn't autodetect yet " 168 pr_debug("Couldn't autodetect yet "
176 "(skb: %02X %02X %02X %02X %02X %02X)\n", 169 "(skb: %02X %02X %02X %02X %02X %02X)\n",
177 pvcc->chan.unit,
178 skb->data[0], skb->data[1], skb->data[2], 170 skb->data[0], skb->data[1], skb->data[2],
179 skb->data[3], skb->data[4], skb->data[5]); 171 skb->data[3], skb->data[4], skb->data[5]);
180 goto error; 172 goto error;
@@ -202,8 +194,7 @@ static int pppoatm_send(struct ppp_channel *chan, struct sk_buff *skb)
202{ 194{
203 struct pppoatm_vcc *pvcc = chan_to_pvcc(chan); 195 struct pppoatm_vcc *pvcc = chan_to_pvcc(chan);
204 ATM_SKB(skb)->vcc = pvcc->atmvcc; 196 ATM_SKB(skb)->vcc = pvcc->atmvcc;
205 DPRINTK("(unit %d): pppoatm_send (skb=0x%p, vcc=0x%p)\n", 197 pr_debug("pppoatm_send (skb=0x%p, vcc=0x%p)\n", skb, pvcc->atmvcc);
206 pvcc->chan.unit, skb, pvcc->atmvcc);
207 if (skb->data[0] == '\0' && (pvcc->flags & SC_COMP_PROT)) 198 if (skb->data[0] == '\0' && (pvcc->flags & SC_COMP_PROT))
208 (void) skb_pull(skb, 1); 199 (void) skb_pull(skb, 1);
209 switch (pvcc->encaps) { /* LLC encapsulation needed */ 200 switch (pvcc->encaps) { /* LLC encapsulation needed */
@@ -228,16 +219,14 @@ static int pppoatm_send(struct ppp_channel *chan, struct sk_buff *skb)
228 goto nospace; 219 goto nospace;
229 break; 220 break;
230 case e_autodetect: 221 case e_autodetect:
231 DPRINTK("(unit %d): Trying to send without setting encaps!\n", 222 pr_debug("Trying to send without setting encaps!\n");
232 pvcc->chan.unit);
233 kfree_skb(skb); 223 kfree_skb(skb);
234 return 1; 224 return 1;
235 } 225 }
236 226
237 atomic_add(skb->truesize, &sk_atm(ATM_SKB(skb)->vcc)->sk_wmem_alloc); 227 atomic_add(skb->truesize, &sk_atm(ATM_SKB(skb)->vcc)->sk_wmem_alloc);
238 ATM_SKB(skb)->atm_options = ATM_SKB(skb)->vcc->atm_options; 228 ATM_SKB(skb)->atm_options = ATM_SKB(skb)->vcc->atm_options;
239 DPRINTK("(unit %d): atm_skb(%p)->vcc(%p)->dev(%p)\n", 229 pr_debug("atm_skb(%p)->vcc(%p)->dev(%p)\n", skb, ATM_SKB(skb)->vcc,
240 pvcc->chan.unit, skb, ATM_SKB(skb)->vcc,
241 ATM_SKB(skb)->vcc->dev); 230 ATM_SKB(skb)->vcc->dev);
242 return ATM_SKB(skb)->vcc->send(ATM_SKB(skb)->vcc, skb) 231 return ATM_SKB(skb)->vcc->send(ATM_SKB(skb)->vcc, skb)
243 ? DROP_PACKET : 1; 232 ? DROP_PACKET : 1;