Re: net/sctp: Use pr_fmt and pr_<level>

Previous thread: [84/91] USB: CP210x Fix Break On/Off by Greg KH on Tuesday, August 24, 2010 - 3:42 pm. (1 message)

Next thread: [82/91] USB: add device IDs for igotu to navman by Greg KH on Tuesday, August 24, 2010 - 3:42 pm. (1 message)
From: Joe Perches
Date: Tuesday, August 24, 2010 - 4:21 pm

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 &quot;: &quot; fmt
Add a missing newline in &quot;Failed bind hash alloc&quot;

Signed-off-by: Joe Perches &lt;joe@perches.com&gt;
---
 include/net/sctp/sctp.h  |   48 ++++++++++++++++++++++++++++-----------------
 net/sctp/associola.c     |    2 +
 net/sctp/chunk.c         |    2 +
 net/sctp/inqueue.c       |    2 +
 net/sctp/ipv6.c          |    4 ++-
 net/sctp/objcnt.c        |    5 ++-
 net/sctp/output.c        |    2 +
 net/sctp/outqueue.c      |   34 +++++++++++++++++---------------
 net/sctp/probe.c         |    4 ++-
 net/sctp/protocol.c      |   17 +++++++--------
 net/sctp/sm_make_chunk.c |    2 +
 net/sctp/sm_sideeffect.c |   21 +++++++++----------
 net/sctp/sm_statefuns.c  |   20 +++++++++---------
 net/sctp/sm_statetable.c |   42 ++++++++++++++++++++--------------------
 net/sctp/socket.c        |   39 ++++++++++++++-----------------------
 net/sctp/transport.c     |    9 ++++---
 16 files changed, 136 insertions(+), 117 deletions(-)

diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
index 65946bc..2cb3980 100644
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -275,24 +275,35 @@ struct sctp_mib {
 /* Print debugging messages.  */
 #if SCTP_DEBUG
 extern int sctp_debug_flag;
-#define SCTP_DEBUG_PRINTK(whatever...) \
-	((void) (sctp_debug_flag &amp;&amp; printk(KERN_DEBUG whatever)))
-#define SCTP_DEBUG_PRINTK_IPADDR(lead, trail, leadparm, saddr, otherparms...) \
-	if (sctp_debug_flag) { \
-		if (saddr-&gt;sa.sa_family == AF_INET6) { \
-			printk(KERN_DEBUG \
-			       lead &quot;%pI6&quot; trail, \
-			       leadparm, \
-			       &amp;saddr-&gt;v6.sin6_addr, \
-			       otherparms); \
-		} else { \
-			printk(KERN_DEBUG \
-			       lead &quot;%pI4&quot; trail, \
-			       leadparm, \
-			       &amp;saddr-&gt;v4.sin_addr.s_addr, \
-			       otherparms); \
-		} \
-	}
+#define ...
From: David Miller
Date: Thursday, August 26, 2010 - 2:12 pm

From: Joe Perches &lt;joe@perches.com&gt;

Applied.
--

Previous thread: [84/91] USB: CP210x Fix Break On/Off by Greg KH on Tuesday, August 24, 2010 - 3:42 pm. (1 message)

Next thread: [82/91] USB: add device IDs for igotu to navman by Greg KH on Tuesday, August 24, 2010 - 3:42 pm. (1 message)