Re: [PATCH 25/90] ARM: OMAP: h4 must have blinky leds!!

Dmitry Torokhov
2007-04-04T20:42:16Z

On 4/4/07, Jan Engelhardt <jengelh@linux01.gwdg.de> wrote:
>
> On Apr 4 2007 12:00, Randy Dunlap wrote:
> >
> >> +static int __init fpga_init(void)
> >> +{
> >> + if (machine_is_omap_h4()
> >> + || machine_is_omap_h3()
> >> + || machine_is_omap_h2()
> >> + || machine_is_omap_perseus2()
> >> + )
> >
> >Perhaps there is nothing in CodingStyle for if () continuation
> >lines. Looks like it is needed. This is ETOOMUCHINDENTATION by
> >at least one tab. Should be more like:
> >
> >+ if (machine_is_omap_h4()
> >+ || machine_is_omap_h3()
> >+ || machine_is_omap_h2()
> >+ || machine_is_omap_perseus2())
>
> My stance, || goes at EOL, and final ) not standalone:
>
> if (foo ||
> bar ||
> baz ||
> etc)
> do_something;
>

I personally ident multi-line conditionals in "if" and "while" with
tabs to the keyword level, then pad with spaces so 2nd+ line starts in
the same column as first part of the condition (i.e one column to the
right from opening paren). Logical operation goes to EOL.

Also with multi-line condition and single-line body I often use braces
to separate them better.

--
Dmitry