[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1203525398.7181.178.camel@localhost>
Date: Wed, 20 Feb 2008 08:36:38 -0800
From: Joe Perches <joe@...ches.com>
To: Patrick McHardy <kaber@...sh.net>
Cc: Pavel Emelyanov <xemul@...nvz.org>,
"J. Bruce Fields" <bfields@...i.umich.edu>,
Linux Netdev List <netdev@...r.kernel.org>
Subject: Re: [PATCH] SUNRPC: Mark buffer used for debug printks
with __maybe_unused
On Wed, 2008-02-20 at 16:35 +0100, Patrick McHardy wrote:
> Alternatively change the dprintk macro to behave similar like
> pr_debug() and mark things like svc_print_addr() __pure, which
> has the advantage that is still performs format checking even
> if debugging is disabled.
I think it's better to change the dprintk style macros
to what Philip Craig suggested.
http://marc.info/?l=linux-wireless&m=120338413108120&w=2
This makes clear to the compiler that the called function is not
going to be used so it can be optimized away, keeps any argument
verification in place, and doesn't require __pure attributes on
arbitrary functions that may be called during the dprintk
#ifdef DEBUG
#define some_print_wrapper(fmt, arg...) \
do { if (0) printk(KERN_DEBUG fmt, ##arg); } while (0)
#else
#define some_print_wrapper(fmt, arg...) \
printk(KERN_DEBUG fmt, ##arg)
#endif
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists