lkml.org 
[lkml]   [2011]   [Jan]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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


\
 
 \ /
  Last update: 2011-01-02 10:13    [W:0.058 / U:1.240 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site