[Jesper Juhl - Wed, Jun 20, 2007 at 11:01:44PM +0200]
| From: Jesper Juhl <[email protected]>
| To: Cyrill Gorcunov <[email protected]>
| Cc: LKML <[email protected]>
| Subject: Re: [PATCH] bracing the loop in kernel/softirq.c
| Date: Wed, 20 Jun 2007 23:01:44 +0200
|
> On 20/06/07, Cyrill Gorcunov <[email protected]> wrote:
>> This trivial patch adds braces over a one-line
>> loop. That makes code...well... little bit
>> convenient for (possible) further modifications.
>>
> That's generally not done.
>
> It's even in Documentation/CodingStyle :
>
> "
> Do not unnecessarily use braces where a single statement will do.
>
> if (condition)
> action();
> "
>
> --
> Jesper Juhl <[email protected]>
> Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html
> Plain text mails only, please http://www.expita.com/nomime.html
>
Hi Jasper,
look, the CodingStyle is absolutely right BUT:
- dropping the braces are good solution for 'if' statement indeed
- dropping the braces are _not_ good for 'do' - 'while' loop 'case
it fails on further loop modifications. Moreover adding these braces
we don't change amount of lines in code! So why souldn't we? I don't
see any reason not to do.
Cyrill
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]