From: Joe Perches <joe@perches.com>
To: Patrick McHardy <kaber@trash.net>
Cc: Pavel Emelyanov <xemul@openvz.org>,
"J. Bruce Fields" <bfields@citi.umich.edu>,
Linux Netdev List <netdev@vger.kernel.org>
Subject: Re: [PATCH] SUNRPC: Mark buffer used for debug printks with __maybe_unused
Date: Wed, 20 Feb 2008 08:36:38 -0800 [thread overview]
Message-ID: <1203525398.7181.178.camel@localhost> (raw)
In-Reply-To: <47BC48C6.3050208@trash.net>
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
next prev parent reply other threads:[~2008-02-20 16:37 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-20 14:02 [PATCH] SUNRPC: Mark buffer used for debug printks with __maybe_unused Pavel Emelyanov
2008-02-20 15:29 ` Joe Perches
2008-02-20 15:31 ` Joe Perches
2008-02-20 15:35 ` Patrick McHardy
2008-02-20 16:27 ` Pavel Emelyanov
2008-02-20 17:00 ` Trond Myklebust
2008-02-20 16:36 ` Joe Perches [this message]
2008-02-20 17:02 ` Trond Myklebust
2008-02-20 17:23 ` Joe Perches
2008-02-20 17:41 ` Trond Myklebust
2008-02-20 15:36 ` Pavel Emelyanov
2008-02-20 15:56 ` Joe Perches
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1203525398.7181.178.camel@localhost \
--to=joe@perches.com \
--cc=bfields@citi.umich.edu \
--cc=kaber@trash.net \
--cc=netdev@vger.kernel.org \
--cc=xemul@openvz.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).