[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ac9c93b10809022357l79d014d3ybb40271b2ae806fd@mail.gmail.com>
Date: Wed, 3 Sep 2008 08:57:35 +0200
From: "Frans Meulenbroeks" <fransmeulenbroeks@...il.com>
To: "Hans Verkuil" <hverkuil@...all.nl>
Cc: LKML <linux-kernel@...r.kernel.org>,
"v4l-dvb maintainer list" <v4l-dvb-maintainer@...uxtv.org>
Subject: Re: CodingStyle question: multiple statements on a single line
2008/9/3 Hans Verkuil <hverkuil@...all.nl>:
[...]
>
> "Don't put multiple statements on a single line unless you have
> something to hide:
>
> if (condition) do_this;
> do_something_everytime;
>
> Don't put multiple assignments on a single line either. Kernel coding
> style is super simple. Avoid tricky expressions."
>
> Does this mean:
>
> 1) Yes, after an 'if' you can put a single statement like this:
>
> if (a) b;
>
> 2) No, never use the 'if (a) b;' construction. Put 'b;' on the next line
> instead.
>
It means 2. The example is definitely tricky. At first sight the
indentation suggests that the 'do_something-everytime" belongs to the
if, so it might put people on the wrong foot.
Suggest the text to be revised though. Some of us are better in
English than others. No need to cause confusion...
just my two eurocents :-)
Frans
[...]
--
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