public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] autofs4: Use no_printk() for no-op DPRINTK() and use __VA_ARGS__ too
@ 2011-08-08 15:10 David Howells
  2011-08-08 16:09 ` Linus Torvalds
  2011-08-08 16:11 ` [PATCH] autofs4: Use no_printk() for no-op DPRINTK() and use __VA_ARGS__ too Joe Perches
  0 siblings, 2 replies; 4+ messages in thread
From: David Howells @ 2011-08-08 15:10 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel, autofs, David Howells, Ian Kent

Use no_printk() for autofs's no-op DPRINTK() to prevent unused statements from
becoming accidentally obsolete, and use __VA_ARGS__ too as that's the standard
way.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Ian Kent <raven@themaw.net>
---

 fs/autofs4/autofs_i.h |   10 +++++++---
 fs/autofs4/waitq.c    |    3 ++-
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/fs/autofs4/autofs_i.h b/fs/autofs4/autofs_i.h
index 475f9c5..c3a419f 100644
--- a/fs/autofs4/autofs_i.h
+++ b/fs/autofs4/autofs_i.h
@@ -40,13 +40,17 @@
 /* #define DEBUG */
 
 #ifdef DEBUG
-#define DPRINTK(fmt, args...)				\
+#define DPRINTK(fmt, ...)				\
 do {							\
 	printk(KERN_DEBUG "pid %d: %s: " fmt "\n",	\
-		current->pid, __func__, ##args);	\
+		current->pid, __func__, ##__VA_ARGS__);	\
 } while (0)
 #else
-#define DPRINTK(fmt, args...) do {} while (0)
+#define DPRINTK(fmt, ...)					\
+do {								\
+	no_printk(KERN_DEBUG "pid %d: %s: " fmt "\n",		\
+		  current->pid, __func__, ##__VA_ARGS__);	\
+} while (0)
 #endif
 
 #define AUTOFS_WARN(fmt, args...)			\
diff --git a/fs/autofs4/waitq.c b/fs/autofs4/waitq.c
index 2543598..6313a0d 100644
--- a/fs/autofs4/waitq.c
+++ b/fs/autofs4/waitq.c
@@ -104,7 +104,8 @@ static void autofs4_notify_daemon(struct autofs_sb_info *sbi,
 	size_t pktsz;
 
 	DPRINTK("wait id = 0x%08lx, name = %.*s, type=%d",
-		wq->wait_queue_token, wq->name.len, wq->name.name, type);
+		(unsigned long)wq->wait_queue_token,
+		wq->name.len, wq->name.name, type);
 
 	memset(&pkt,0,sizeof pkt); /* For security reasons */
 


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-08-09  0:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-08 15:10 [PATCH] autofs4: Use no_printk() for no-op DPRINTK() and use __VA_ARGS__ too David Howells
2011-08-08 16:09 ` Linus Torvalds
2011-08-09  0:56   ` [PATCH] autofs4: Use pr_fmt and pr_<level> Joe Perches
2011-08-08 16:11 ` [PATCH] autofs4: Use no_printk() for no-op DPRINTK() and use __VA_ARGS__ too Joe Perches

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox