Re: [PATCH] autofs4: Use no_printk() for no-op DPRINTK() and use__VA_ARGS__ too

From: Linus Torvalds
Date: Mon Aug 08 2011 - 12:10:03 EST


On Mon, Aug 8, 2011 at 8:10 AM, David Howells <dhowells@xxxxxxxxxx> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/