diff options
| author | Joe Perches <joe@perches.com> | 2010-08-24 09:21:08 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2010-08-26 17:11:48 -0400 |
| commit | 145ce502e44b57c074c72cfdc855557e19026999 (patch) | |
| tree | fd663feae03f5c5f4a31ceecd6a61e790344b8b3 /include/net/sctp | |
| parent | dee06e4702b5a64b9ca81e650d66223c5b3e7f14 (diff) | |
net/sctp: Use pr_fmt and pr_<level>
Change SCTP_DEBUG_PRINTK and SCTP_DEBUG_PRINTK_IPADDR to
use do { print } while (0) guards.
Add SCTP_DEBUG_PRINTK_CONT to fix errors in log when
lines were continued.
Add #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
Add a missing newline in "Failed bind hash alloc"
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/sctp')
| -rw-r--r-- | include/net/sctp/sctp.h | 48 |
1 files changed, 30 insertions, 18 deletions
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h index 65946bc43d0..2cb3980b161 100644 --- a/include/net/sctp/sctp.h +++ b/include/net/sctp/sctp.h | |||
| @@ -275,24 +275,35 @@ struct sctp_mib { | |||
| 275 | /* Print debugging messages. */ | 275 | /* Print debugging messages. */ |
| 276 | #if SCTP_DEBUG | 276 | #if SCTP_DEBUG |
| 277 | extern int sctp_debug_flag; | 277 | extern int sctp_debug_flag; |
| 278 | #define SCTP_DEBUG_PRINTK(whatever...) \ | 278 | #define SCTP_DEBUG_PRINTK(fmt, args...) \ |
| 279 | ((void) (sctp_debug_flag && printk(KERN_DEBUG whatever))) | 279 | do { \ |
| 280 | #define SCTP_DEBUG_PRINTK_IPADDR(lead, trail, leadparm, saddr, otherparms...) \ | 280 | if (sctp_debug_flag) \ |
| 281 | if (sctp_debug_flag) { \ | 281 | printk(KERN_DEBUG pr_fmt(fmt), ##args); \ |
| 282 | if (saddr->sa.sa_family == AF_INET6) { \ | 282 | } while (0) |
| 283 | printk(KERN_DEBUG \ | 283 | #define SCTP_DEBUG_PRINTK_CONT(fmt, args...) \ |
| 284 | lead "%pI6" trail, \ | 284 | do { \ |
| 285 | leadparm, \ | 285 | if (sctp_debug_flag) \ |
| 286 | &saddr->v6.sin6_addr, \ | 286 | pr_cont(fmt, ##args); \ |
| 287 | otherparms); \ | 287 | } while (0) |
| 288 | } else { \ | 288 | #define SCTP_DEBUG_PRINTK_IPADDR(fmt_lead, fmt_trail, \ |
| 289 | printk(KERN_DEBUG \ | 289 | args_lead, saddr, args_trail...) \ |
| 290 | lead "%pI4" trail, \ | 290 | do { \ |
| 291 | leadparm, \ | 291 | if (sctp_debug_flag) { \ |
| 292 | &saddr->v4.sin_addr.s_addr, \ | 292 | if (saddr->sa.sa_family == AF_INET6) { \ |
| 293 | otherparms); \ | 293 | printk(KERN_DEBUG \ |
| 294 | } \ | 294 | pr_fmt(fmt_lead "%pI6" fmt_trail), \ |
| 295 | } | 295 | args_lead, \ |
| 296 | &saddr->v6.sin6_addr, \ | ||
| 297 | args_trail); \ | ||
| 298 | } else { \ | ||
| 299 | printk(KERN_DEBUG \ | ||
| 300 | pr_fmt(fmt_lead "%pI4" fmt_trail), \ | ||
| 301 | args_lead, \ | ||
| 302 | &saddr->v4.sin_addr.s_addr, \ | ||
| 303 | args_trail); \ | ||
| 304 | } \ | ||
| 305 | } \ | ||
| 306 | } while (0) | ||
| 296 | #define SCTP_ENABLE_DEBUG { sctp_debug_flag = 1; } | 307 | #define SCTP_ENABLE_DEBUG { sctp_debug_flag = 1; } |
| 297 | #define SCTP_DISABLE_DEBUG { sctp_debug_flag = 0; } | 308 | #define SCTP_DISABLE_DEBUG { sctp_debug_flag = 0; } |
| 298 | 309 | ||
| @@ -306,6 +317,7 @@ extern int sctp_debug_flag; | |||
| 306 | #else /* SCTP_DEBUG */ | 317 | #else /* SCTP_DEBUG */ |
| 307 | 318 | ||
| 308 | #define SCTP_DEBUG_PRINTK(whatever...) | 319 | #define SCTP_DEBUG_PRINTK(whatever...) |
| 320 | #define SCTP_DEBUG_PRINTK_CONT(fmt, args...) | ||
| 309 | #define SCTP_DEBUG_PRINTK_IPADDR(whatever...) | 321 | #define SCTP_DEBUG_PRINTK_IPADDR(whatever...) |
| 310 | #define SCTP_ENABLE_DEBUG | 322 | #define SCTP_ENABLE_DEBUG |
| 311 | #define SCTP_DISABLE_DEBUG | 323 | #define SCTP_DISABLE_DEBUG |
