[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1259247179.31676.112.camel@laptop>
Date: Thu, 26 Nov 2009 15:52:59 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Uwe Kleine-König
<u.kleine-koenig@...gutronix.de>
Cc: linux-kernel@...r.kernel.org, Junio C Hamano <gitster@...ox.com>,
Randy Dunlap <rdunlap@...otime.net>,
Teemu Likonen <tlikonen@....fi>, Jiri Kosina <jkosina@...e.cz>,
Dan Carpenter <error27@...il.com>,
Martin Olsson <martin@...imum.se>, linux-doc@...r.kernel.org,
Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH RFC] Codingstyle: allow omitting braces for all single
statement branches
On Thu, 2009-11-26 at 10:26 +0100, Uwe Kleine-König wrote:
> -This does not apply if one branch of a conditional statement is a single
> -statement. Use braces in both branches.
> -
> -if (condition) {
> - do_this();
> - do_that();
> -} else {
> - otherwise();
> -}
> +If not all branches of a conditional statement are single statements you might
> +use braces for both branches.
> +
> + if (condition) {
> + do_this();
> + do_that();
> + } else
> + otherwise();
> +
> +or
> +
> + if (condition) {
> + do_this();
> + do_that();
> + } else {
> + otherwise();
> + }
>
> 3.1: Spaces
Andrew recently objected to this pattern, and I tend to agree with him
although I might be guilty of a few such cases myself.
--
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