[Gluster-devel] if/else coding style :-)
Jeff Darcy
jdarcy at redhat.com
Mon Oct 13 20:34:48 UTC 2014
----- Original Message -----
> +1 to existing Linux kernel style. Moreover, its a style which is used
> heavily in existing code base. I don't see any advantage in changing the
> style now.
It's not a change. It's already common in our code, if not actually the *most* common style.
% find . -name '*.c' | xargs grep '} else {' | wc -l
1284
jeff at odroid3 ~/glusterfs (nsr-design)
% find . -name '*.c' | xargs grep 'else {' | wc -l
1431
I haven't checked whether *all* instances of the latter follow a line with a closing brace, but I would bet that the vast majority do because "braces around all if/else blocks" has also been part of our coding style since forever. Again: checkpatch.pl was *already* rejecting a valid and common form when it was first introduced. If people want to fix places where they feel that's still happening, I strongly suggest submitting patches against checkpatch.pl and we can discuss them there.
More information about the Gluster-devel
mailing list