Messages in this thread | | | Date | Sun, 2 Jan 2011 10:11:33 +0100 | From | Pavel Machek <> | Subject | Re: [PATCH] ext3: Coding style fix in namei.c |
| |
Hi!
> > * break long lines (using temp variables if needed) > > * merge short lines > > * put open brace on the same line > > * use C89-style comments > > * remove a space between function name and parenthesis > > * remove a space between '*' and pointer name > > * add a space after ',' > > * other random whitespace fixes > > > > Signed-off-by: Namhyung Kim <namhyung@gmail.com> > > What's the benefit of such massive cleanup patches, really? Does it really enhance readability _that_ much? > > I believe in cleaning up code as I make substantive, useful change, but code churn for code churn's sake has a number of downsides: > > *) It breaks other people's patches that might be pending (probably not as much of an issue for ext3)
> > @@ -276,12 +265,9 @@ static struct stats dx_show_leaf(struct dx_hash_info *hinfo, struct ext3_dir_ent > > struct dx_hash_info h = *hinfo; > > > > printk("names: "); > > - while ((char *) de < base + size) > > - { > > - if (de->inode) > > - { > > - if (show_names) > > - { > > + while ((char *) de < base + size) { > > + if (de->inode) { > > + if (show_names) { > > int len = de->name_len; > > char *name = de->name; > > while (len--) printk("%c", *name++);
Code really looks better afterwards... and this way, the next person trying to modify the file will not have to fix it, first... Pavel -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
| |