Re: [PATCH] jffs2 whitespace

Jörn Engel
2005-09-25T15:06:39Z

On Thu, 22 September 2005 18:05:49 -0600, Peter Grayson wrote:
>
> I'm not sure if anyone else really cares about these kind of cleanup
> changes, but just in case someone does, here is a patch that fixes up
> several whitespace issues in the jffs2 code.
>
> I believe all of these changes are consistent with what the mtd
> developers like to see in the code. There seems to be a lot of precedent
> for all of these changes.
>
> There are no functional changes in this patch.
>
> Here are the specific issues addressed:
>
> * Remove all trailing whitespace
> * Use tab-indentation consistently (there was some space indentation)
> * Consistent placement of parenthesis for "if", "for", "while", and
> "switch" expressions (i.e. "if (a == b)" instead of "if( a == b )")
> * Space follows all commas
> * Space around binary operators (i.e. "a = b + c;" instead of "a=b+c;")

This one may be controversial. Ime, there are cases when spaces
should not be used based on some strict rule, but rather to logically
group expressions.

> * Opening brace of function definition on its own line
> * Put the "else" on the same line as the preceding and following braces
>
> This is a rather large patch, but the changes are trivial. If this patch
> goes over well, I would be happy to create a similar patch for the rest
> of the mtd code.

I'm not sure about this. Apart from the binary operator cases, your
changes are definitely a slight improvement. But the patch is also
peeing on every lantern pole in the county:
61 files changed, 1677 insertions(+), 1713 deletions(-)

How can I trust you that you didn't introduce a security problem on
line 6789 of your 9485 line patch, by intention or not. I'd have to
read it all, which is quite boring.

And if all goes well, pretty much every single patch maintained
outside of cvs would break after merging this. There must be a
collision _somewhere_, after all.

So I guess the short answer is "no".

My usual approach to whitespace cleanup, btw., is as a first step
before I change some code anyway. Even whitespace patches should get
tested and since I need some testing anyway and they help me read and
change the code, the cleanup is gaining me more than it costs.

Jörn

--
A victorious army first wins and then seeks battle.
-- Sun Tzu