diff options
author | Joe Perches <joe@perches.com> | 2012-05-17 06:25:49 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-05-17 18:45:20 -0400 |
commit | a508da6cc0093171833efb8376b00473f24221b9 (patch) | |
tree | d2578008abfaf33a59da65a64b916c62ee79eedd /net/lapb/lapb_iface.c | |
parent | a5e371f61ad33c07b28e7c9b60c78d71fdd34e2a (diff) |
lapb: Neaten debugging
Enable dynamic debugging and remove a bunch of #ifdef/#endifs.
Add a lapb_dbg(level, fmt, ...) macro and replace the
printk(KERN_DEBUG uses.
Add pr_fmt and remove embedded prefixes.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/lapb/lapb_iface.c')
-rw-r--r-- | net/lapb/lapb_iface.c | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/net/lapb/lapb_iface.c b/net/lapb/lapb_iface.c index ab3d35f23257..3cdaa046c1bc 100644 --- a/net/lapb/lapb_iface.c +++ b/net/lapb/lapb_iface.c | |||
@@ -15,6 +15,8 @@ | |||
15 | * 2000-10-29 Henner Eisen lapb_data_indication() return status. | 15 | * 2000-10-29 Henner Eisen lapb_data_indication() return status. |
16 | */ | 16 | */ |
17 | 17 | ||
18 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
19 | |||
18 | #include <linux/module.h> | 20 | #include <linux/module.h> |
19 | #include <linux/errno.h> | 21 | #include <linux/errno.h> |
20 | #include <linux/types.h> | 22 | #include <linux/types.h> |
@@ -279,9 +281,7 @@ int lapb_connect_request(struct net_device *dev) | |||
279 | 281 | ||
280 | lapb_establish_data_link(lapb); | 282 | lapb_establish_data_link(lapb); |
281 | 283 | ||
282 | #if LAPB_DEBUG > 0 | 284 | lapb_dbg(0, "(%p) S0 -> S1\n", lapb->dev); |
283 | printk(KERN_DEBUG "lapb: (%p) S0 -> S1\n", lapb->dev); | ||
284 | #endif | ||
285 | lapb->state = LAPB_STATE_1; | 285 | lapb->state = LAPB_STATE_1; |
286 | 286 | ||
287 | rc = LAPB_OK; | 287 | rc = LAPB_OK; |
@@ -305,12 +305,8 @@ int lapb_disconnect_request(struct net_device *dev) | |||
305 | goto out_put; | 305 | goto out_put; |
306 | 306 | ||
307 | case LAPB_STATE_1: | 307 | case LAPB_STATE_1: |
308 | #if LAPB_DEBUG > 1 | 308 | lapb_dbg(1, "(%p) S1 TX DISC(1)\n", lapb->dev); |
309 | printk(KERN_DEBUG "lapb: (%p) S1 TX DISC(1)\n", lapb->dev); | 309 | lapb_dbg(0, "(%p) S1 -> S0\n", lapb->dev); |
310 | #endif | ||
311 | #if LAPB_DEBUG > 0 | ||
312 | printk(KERN_DEBUG "lapb: (%p) S1 -> S0\n", lapb->dev); | ||
313 | #endif | ||
314 | lapb_send_control(lapb, LAPB_DISC, LAPB_POLLON, LAPB_COMMAND); | 310 | lapb_send_control(lapb, LAPB_DISC, LAPB_POLLON, LAPB_COMMAND); |
315 | lapb->state = LAPB_STATE_0; | 311 | lapb->state = LAPB_STATE_0; |
316 | lapb_start_t1timer(lapb); | 312 | lapb_start_t1timer(lapb); |
@@ -329,12 +325,8 @@ int lapb_disconnect_request(struct net_device *dev) | |||
329 | lapb_stop_t2timer(lapb); | 325 | lapb_stop_t2timer(lapb); |
330 | lapb->state = LAPB_STATE_2; | 326 | lapb->state = LAPB_STATE_2; |
331 | 327 | ||
332 | #if LAPB_DEBUG > 1 | 328 | lapb_dbg(1, "(%p) S3 DISC(1)\n", lapb->dev); |
333 | printk(KERN_DEBUG "lapb: (%p) S3 DISC(1)\n", lapb->dev); | 329 | lapb_dbg(0, "(%p) S3 -> S2\n", lapb->dev); |
334 | #endif | ||
335 | #if LAPB_DEBUG > 0 | ||
336 | printk(KERN_DEBUG "lapb: (%p) S3 -> S2\n", lapb->dev); | ||
337 | #endif | ||
338 | 330 | ||
339 | rc = LAPB_OK; | 331 | rc = LAPB_OK; |
340 | out_put: | 332 | out_put: |