[PATCH] [MTD] CORE: Use list_for_each_entry[_safe] where appropriate.
Chris Malley
mail at chrismalley.co.uk
Sat May 17 16:08:05 EDT 2008
On Sat, 2008-05-17 at 21:49 +0200, Jörn Engel wrote:
> On Sat, 17 May 2008 18:54:05 +0100, Chris Malley wrote:
> >
> > From: Chris Malley <mail at chrismalley.co.uk>
> >
> > Should be no functional changes, just a bit of janitorial work
> > to remove temporary pointers and make some functions a bit more readable.
>
>
> > - struct list_head *this;
> > + struct mtd_blktrans_dev *this;
> > int last_devnum = -1;
> > struct gendisk *gd;
> >
> > @@ -221,25 +221,24 @@ int add_mtd_blktrans_dev(struct mtd_blktrans_dev *new)
> > BUG();
> > }
> >
> > - list_for_each(this, &tr->devs) {
> > - struct mtd_blktrans_dev *d = list_entry(this, struct mtd_blktrans_dev, list);
>
> I guess whoever originally wrote the code used "d" for ..._dev. And in
> spite of being just one letter, I find it more descriptive than "this".
> Would you mind killing "this" instead of "d"? And likewise in the other
> hunks, always nuke "this", as it has zero descriptiveness.
OK, I wasn't sure what people preferred; I'll change to use the original
identifiers.
> Otherwise a nice cleanup. Did you check that the resulting object code
> remains identical?
Not yet, I'll do this before posting an updated version. Thanks for the
feedback.
Chris
More information about the linux-mtd
mailing list