From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 1/4] fs/mount: add autodetection type support
Date: Mon, 13 Aug 2012 10:16:57 +0200 [thread overview]
Message-ID: <20120813081657.GO25520@pengutronix.de> (raw)
In-Reply-To: <20120813073001.GN6271@game.jcrosoft.org>
On Mon, Aug 13, 2012 at 09:30:01AM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> On 09:08 Mon 13 Aug , Uwe Kleine-König wrote:
> > Hello,
> >
> > On Sun, Aug 12, 2012 at 01:49:36PM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > > +static const char * detect_fs(const char *filename)
> > > +{
> > > + enum filetype type = file_name_detect_type(filename);
> > > + struct driver_d *drv;
> > > + struct fs_driver_d *fdrv;
> > > +
> > > + if (type == filetype_unknown)
> > > + return NULL;
> > > +
> > > + for_each_driver(drv) {
> > > + fdrv = drv_to_fs_driver(drv);
> > > +
> > > + if (drv->bus != &fs_bus)
> > > + continue;
> > > +
> > > + if(type == fdrv->type)
> > > + return drv->name;
> > fdrv could be local to this loop only.
> I never declare a var in a loop
reading over
git log --grep=scope
in the kernel suggests that at least there it's considered good style.
With some false hits the list includes:
ccece235d3737221e7a1118fdbd8474112adac84:
Finally, move the definition of the local variable "i"
to the innermost scope in which it's needed.
22a4cca2f4c2d60c703cdc42158c907570f508e6:
Reduced the scope of the loop variable in
e1000e_write_itr().
2c2453f3e46139b86c1e5b0fbd821823b04e4ada:
Patch shortens locals scope ...
74ad8fdaefe6ccb8ef1918394a9d04a036658346:
Shorten scope for iobase
which all got in after v3.6-rc1.
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2012-08-13 8:17 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-12 11:46 [PATCH 0/4] fs/mount: add autodetection support Jean-Christophe PLAGNIOL-VILLARD
2012-08-12 11:49 ` [PATCH 1/4] fs/mount: add autodetection type support Jean-Christophe PLAGNIOL-VILLARD
2012-08-12 11:49 ` [PATCH 2/4] filetype: add fat filesystem support Jean-Christophe PLAGNIOL-VILLARD
2012-08-12 11:49 ` [PATCH 3/4] fs/fat: add filetype Jean-Christophe PLAGNIOL-VILLARD
2012-08-12 11:49 ` [PATCH 4/4] command/mount: add autodetection support Jean-Christophe PLAGNIOL-VILLARD
2012-08-12 12:43 ` Sascha Hauer
2012-08-12 12:46 ` [PATCH 1/4] fs/mount: add autodetection type support Sascha Hauer
2012-08-13 7:08 ` Uwe Kleine-König
2012-08-13 7:30 ` Jean-Christophe PLAGNIOL-VILLARD
2012-08-13 8:16 ` Uwe Kleine-König [this message]
2012-08-13 10:56 ` Jean-Christophe PLAGNIOL-VILLARD
2012-08-12 18:05 [PATCH 0/4 v2] fs/mount: add autodetection support Jean-Christophe PLAGNIOL-VILLARD
2012-08-12 18:10 ` [PATCH 1/4] fs/mount: add autodetection type support Jean-Christophe PLAGNIOL-VILLARD
2012-08-13 18:49 ` Sascha Hauer
2012-08-15 7:25 ` Jean-Christophe PLAGNIOL-VILLARD
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=20120813081657.GO25520@pengutronix.de \
--to=u.kleine-koenig@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=plagnioj@jcrosoft.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