lkml.org 
[lkml]   [2011]   [Aug]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] autofs4: Use no_printk() for no-op DPRINTK() and use __VA_ARGS__ too
On Mon, Aug 8, 2011 at 8:10 AM, David Howells <dhowells@redhat.com> wrote:
> 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.

Gaah. May I suggest just avoiding the duplication by doing

#ifdef DEBUG
# define autofs_debug_printk printk
#else
# define autofs_debug_printk no_printk
#endif

#define DPRINTK(fmt, ...) \
autofs_debug_printk(KERN_DEBUG "pid %d: %s: " fmt "\n", \
current->pid, __func__, ##__VA_ARGS__)

which also drops the pointless do { } while (0) protection since it's
already a well-formed statement?

Linus


\
 
 \ /
  Last update: 2011-08-08 18:13    [W:0.051 / U:0.308 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site