From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Roland Dreier <rdreier@cisco.com>
Cc: Marcin Slusarz <marcin.slusarz@gmail.com>,
LKML <linux-kernel@vger.kernel.org>,
linux-scsi@vger.kernel.org
Subject: Re: [PATCH 12/14] scsi: use printk_once
Date: Tue, 11 Aug 2009 11:50:28 -0500 [thread overview]
Message-ID: <1250009428.4301.59.camel@mulgrave.site> (raw)
In-Reply-To: <adahbwe70xz.fsf@cisco.com>
On Tue, 2009-08-11 at 09:46 -0700, Roland Dreier wrote:
> > > - static int vers_printed;
> > > -
> > > - if (!vers_printed) {
> > > - printk(KERN_INFO "%s", version);
> > > - vers_printed = 1;
> > > - }
> > > + printk_once(KERN_INFO "%s", version);
>
> > There's really no point to this beyond code churn. Both patterns are
> > correct uses so conversion buys us nothing.
>
> It's a pretty small gain but I do think 6 lines -> 1 line does have value.
Not at the expense of churning the code base of marginal drivers.
I'm not entirely convinced this is a good pattern to begin with. If you
add too many patterns you're effectively developing an overly complex
development language and rule set. Even if I go with this on the basis
of readability (as you say, one line for six), then I still don't think
we should churn the code base to convert correct open coding to it; we
should just use it ongoing.
James
next prev parent reply other threads:[~2009-08-11 16:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1249847649-11631-1-git-send-email-marcin.slusarz@gmail.com>
2009-08-09 19:54 ` [PATCH 12/14] scsi: use printk_once Marcin Slusarz
2009-08-11 16:40 ` James Bottomley
2009-08-11 16:46 ` Roland Dreier
2009-08-11 16:50 ` James Bottomley [this message]
2009-08-11 16:49 ` 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=1250009428.4301.59.camel@mulgrave.site \
--to=james.bottomley@hansenpartnership.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=marcin.slusarz@gmail.com \
--cc=rdreier@cisco.com \
/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