[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1401125290.519.18.camel@joe-AO725>
Date: Mon, 26 May 2014 10:28:10 -0700
From: Joe Perches <joe@...ches.com>
To: Willy Tarreau <w@....eu>
Cc: Dominique van den Broeck <domdevlin@...e.fr>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/3] staging: panel: (coding style) Matching braces
On Mon, 2014-05-26 at 16:28 +0200, Willy Tarreau wrote:
> I believe that most of the kernel code prefers the two-line format resluting
> in this instead :
>
> }
> else if (*esc >= 'A' && *esc <= 'Z') {
> value |= (*esc - 'A' + 10) << shift;
> }
> else if (*esc >= 'a' && *esc <= 'z') {
> value |= (*esc - 'a' + 10) << shift;
> }
> else {
grep shows what kernel style is most used.
Your form:
}
else if (...) {
(This shows 3 lines per instance)
$ grep-2.5.4 -rP --include=*.[ch] '}\n[ \t]*else if.*{\n' * | wc -l
909
Generally used form:
} else if (...) {
(mostly shows 2 lines per instance)
$ grep-2.5.4 -rP --include=*.[ch] '} else if.*{\n' * | wc -l
31653
That's ~50:1 preference for "} else if (...) {"
> It's just a matter of taste I know,
true enough.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists