From: Joe Perches <joe@perches.com>
To: Trond Myklebust <trond.myklebust@fys.uio.no>
Cc: Patrick McHardy <kaber@trash.net>,
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 09:23:24 -0800 [thread overview]
Message-ID: <1203528204.7181.193.camel@localhost> (raw)
In-Reply-To: <1203526956.13125.14.camel@heimdal.trondhjem.org>
On Wed, 2008-02-20 at 12:02 -0500, Trond Myklebust wrote:
> > #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
> Have you actually read include/linux/sunrpc/debug.h?
Yes, I have.
What's there:
#define dfprintk(fac, args...) do ; while (0)
vs what's suggested:
#define dfprintk(fac, args...) \
do { if (0) printk(##args); } while (0);
No argument verification is done to args
There has been code that fails to compile with -DDEBUG when
the code use two different #ifdef DEBUG #else macros.
I think some of the USB code was reworked because of that.
The extra verification is just a guard against bad arguments
when compiled normally. It's similar to what's done in kernel.h
pr_debug without the __attribute__((format(printf,x,y))) so
that calls made as arguments to functions aren't called
unnecessarily.
cheers, Joe
next prev parent reply other threads:[~2008-02-20 17:24 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
2008-02-20 17:02 ` Trond Myklebust
2008-02-20 17:23 ` Joe Perches [this message]
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=1203528204.7181.193.camel@localhost \
--to=joe@perches.com \
--cc=bfields@citi.umich.edu \
--cc=kaber@trash.net \
--cc=netdev@vger.kernel.org \
--cc=trond.myklebust@fys.uio.no \
--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).