From: Joe Perches <joe@perches.com>
To: Finn Thain <fthain@telegraphics.com.au>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>,
"James E.J. Bottomley" <JBottomley@parallels.com>,
scsi <linux-scsi@vger.kernel.org>, Sam Creasey <sammy@sammy.net>,
Russell King <linux@arm.linux.org.uk>,
Michael Schmitz <schmitz@debian.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
Linux/m68k <linux-m68k@vger.kernel.org>
Subject: Re: [PATCH 00/12] scsi/NCR5380: fix debugging macros and #include structure
Date: Tue, 18 Mar 2014 18:54:41 -0700 [thread overview]
Message-ID: <1395194081.8649.7.camel@joe-AO722> (raw)
In-Reply-To: <alpine.LNX.2.00.1403191240001.23002@nippy.intranet>
On Wed, 2014-03-19 at 12:46 +1100, Finn Thain wrote:
> On Tue, 18 Mar 2014, Joe Perches wrote:
>
> > But using "if (0)" prevents the no_printk from occurring at all so there
> > would be no side-effects and the format & args would still be verified
> > by the compiler.
>
> I'd prefer this (for symmetry and clarity):
>
> #if NDEBUG
> #define dprintk(flg, fmt, ...) \
> do { if ((NDEBUG) & (flg)) pr_debug(fmt, ## __VA_ARGS__); } while (0)
> #else
> #define dprintk(flg, fmt, ...) \
> do { if (0) pr_debug(fmt, ## __VA_ARGS__); } while (0)
> #endif
>
> But you seem to be asking for this instead:
>
> #if NDEBUG
> #define dprintk(flg, fmt, ...) \
> do { if ((NDEBUG) & (flg)) pr_debug(fmt, ## __VA_ARGS__); } while (0)
> #else
> #define dprintk(flg, fmt, ...) \
> do { if (0) no_printk(fmt, ## __VA_ARGS__); } while (0)
> #endif
>
> Why is that better?
It's not to me.
I suggested exactly your first block with if (0) pr_debug...
in the first thing I wrote.
https://lkml.org/lkml/2014/3/18/216
Geert suggested no_printk.
cheers, Joe
next prev parent reply other threads:[~2014-03-19 1:54 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-18 0:28 [PATCH 00/12] scsi/NCR5380: fix debugging macros and #include structure Finn Thain
2014-03-18 3:19 ` Joe Perches
2014-03-18 12:00 ` Finn Thain
2014-03-18 12:45 ` Joe Perches
2014-03-18 12:55 ` Geert Uytterhoeven
2014-03-18 13:07 ` Joe Perches
2014-03-18 13:13 ` Geert Uytterhoeven
2014-03-18 13:20 ` Joe Perches
2014-03-18 23:14 ` Finn Thain
2014-03-19 0:47 ` Joe Perches
2014-03-19 1:46 ` Finn Thain
2014-03-19 1:54 ` Joe Perches [this message]
-- strict thread matches above, loose matches on Subject: below --
2014-03-18 0:42 Finn Thain
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=1395194081.8649.7.camel@joe-AO722 \
--to=joe@perches.com \
--cc=JBottomley@parallels.com \
--cc=fthain@telegraphics.com.au \
--cc=geert@linux-m68k.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-m68k@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=sammy@sammy.net \
--cc=schmitz@debian.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