Re: [RFC v6 01/23] clocksource: sh_cmt: compute rate before registration again

From: Joe Perches
Date: Sat Sep 10 2016 - 14:52:10 EST


On Sat, 2016-09-10 at 14:56 +0200, Thomas Gleixner wrote:
> if (foo)
> bar(foo->something, foo->somemore, foo->other,
> CONST);)
> else
> rab();
>
>
> Is NOT. Simply because the pattern of a 'if ()' condition without braces
> suggests a single line statement to follow. Then the reading flow stops
> because there is more than one line. While:

> if (foo) {
> bar(foo->something, foo->somemore, foo->other,
> CONST);)
> } else {
> rab();
> }

While I mostly agree, CodingStyle says:

------------------------------------------------------

Do not unnecessarily use braces where a single statement will do.

if (condition)
action();

and

if (condition)
do_this();
else
do_that();

------------------------------------------------------

Perhaps that should be "with single line statements" instead.
>