[PATCH] mtd: nand: use a local variable to simplify the nand_scan_tail

Gupta, Pekon pekon at ti.com
Sun Oct 20 00:01:11 PDT 2013


> From: Ezequiel Garcia [mailto:ezequiel.garcia at free-electrons.com]
> > On Fri, Oct 18, 2013 at 02:11:19PM +0000, Gupta, Pekon wrote:
> > > From: Huang Shijie
> > > There are too many "chip->ecc" in the nand_scan_tail() which makes the
> > > eyes
> > > sore.
> > >
> > > This patch uses a local variable "ecc" to replace the "chip->ecc" to
> > > make the code more graceful.
> > >
> > > Do the code change with "s/chip->ecc\./ecc->/g" in the nand_scan_tail,
> > > and also change some lines by hand.
> > >
> > > Signed-off-by: Huang Shijie <b32955 at freescale.com>
> > >
> > Personally I won't prefer such stand-alone cleanup  _unless_ there is
> > major driver re-write of the code, because this breaks the traceability
> > via 'git blame'. And even in that case, this change should be applied first,
> > and the other functional updates later.
> >
> 
> Hm.. I'm not sure I agree here. I like this patch and I like the effect
> it has on nand_scan_tail().
> 
> On a personal note, I hardly ever use git blame at all (because it's dead
> slow). Instead, I just run git log ${file} and get the latest changes on
> that file.
> 
Its rather difficult to use 'git log' especially when you are tracing or debugging
a generic driver, and want to know why this piece of code was introduced,
and the idea behind it. 'git log' won’t show line by line commit details.

So, I'm not against this clean-up, just that please schedule this patch
*before some major re-write of nand_scan_tail()*, so that the 'git blame'
is preserved for the new changes after this cleanup.
I remember there is another major patch from Shijie for renaming
chip->ecc.size and adding them as sysfs entry. Good to merge all such
renaming patches in one-go.


With regards, pekon


More information about the linux-mtd mailing list