coding style for long conditions (WAS: Re: [PATCH 25/90] ... blinky leds!!)

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Jan Engelhardt <jengelh@...>
Cc: Randy Dunlap <randy.dunlap@...>, Tony Lindgren <tony@...>, <linux-kernel@...>, David Brownell <dbrownell@...>
Date: Friday, April 6, 2007 - 1:29 pm

On Thursday 05 April 2007 1:35 pm, Jan Engelhardt wrote:

Yes. Where "indent" is measured -- always!! -- in tabs.
Documentation/Coding style is quite explicit on that point:

Outside of comments, documentation and except in Kconfig,
spaces are never used for indentation ...

Note also:

Statements longer than 80 columns will be broken into sensible
chunks. Descendants are always substantially shorter than the
parent and are placed substantially to the right. The same applies
to function headers with a long argument list. Long strings are
as well broken into shorter strings.

So not just "more" indent, but "substantially more". (Although one
could quibble, this is "expression" not "statement". Don't quibble.)

> and that the inner block code

We disagree. The "inner" block should in all cases have one-tab indent.

And CodingStyle says that line 2 should have "substantially more" indent...

Think of it this way: when the condition becomes so complex that it
no longer fits on one line, that block should never be re-indented.
Only the condition needs to be reworked to fit into 80 columns.

The entire point of "substantially more" is to stand out from the normal
"indent by one tab" rule" ... so that it's not mistaken for anything
except a line-wrap reformat.

> Using

No, that's a clear violation of CodingStyle on two separate points:
(a) the "always use tabs" rule, (b) the "substantially more" rule.

Note also that the notion of using spaces is for indents is clearly
described there as "heresy" .. your fu needs review if not overhaul.

- Dave

-

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 20/90] ARM: OMAP: gpio init section cleanups, Tony Lindgren, (Wed Apr 4, 2:04 pm)
[PATCH 21/90] ARM: OMAP: gpio object shrinkage, cleanup, Tony Lindgren, (Wed Apr 4, 2:05 pm)
[PATCH 23/90] ARM: OMAP: PalmZ71 extra brace fix, Tony Lindgren, (Wed Apr 4, 2:05 pm)
[PATCH 24/90] ARM: OMAP: Fix typo in gpio, Tony Lindgren, (Wed Apr 4, 2:05 pm)
[PATCH 25/90] ARM: OMAP: h4 must have blinky leds!!, Tony Lindgren, (Wed Apr 4, 2:05 pm)
Re: [PATCH 25/90] ARM: OMAP: h4 must have blinky leds!!, Dmitry Torokhov, (Wed Apr 4, 4:47 pm)
Re: [PATCH 25/90] ARM: OMAP: h4 must have blinky leds!!, David Brownell, (Wed Apr 4, 4:59 pm)
Re: [PATCH 25/90] ARM: OMAP: h4 must have blinky leds!!, Jan Engelhardt, (Wed Apr 4, 4:06 pm)
Re: [PATCH 25/90] ARM: OMAP: h4 must have blinky leds!!, David Brownell, (Wed Apr 4, 4:51 pm)
Re: [PATCH 25/90] ARM: OMAP: h4 must have blinky leds!!, Jan Engelhardt, (Wed Apr 4, 10:15 pm)
Re: [PATCH 25/90] ARM: OMAP: h4 must have blinky leds!!, Randy Dunlap, (Thu Apr 5, 12:18 am)
Re: [PATCH 25/90] ARM: OMAP: h4 must have blinky leds!!, David Brownell, (Thu Apr 5, 2:19 pm)
Re: [PATCH 25/90] ARM: OMAP: h4 must have blinky leds!!, Jan Engelhardt, (Thu Apr 5, 4:35 pm)
coding style for long conditions (WAS: Re: [PATCH 25/90] ......, David Brownell, (Fri Apr 6, 1:29 pm)
Re: coding style for long conditions, Junio C Hamano, (Sat Apr 7, 4:01 am)
Re: coding style for long conditions, David Brownell, (Mon Apr 9, 11:14 am)
Re: coding style for long conditions, Roland Dreier, (Fri Apr 6, 5:38 pm)
Re: coding style for long conditions, Scott Preece, (Mon Apr 9, 11:45 am)
Re: coding style for long conditions, David Brownell, (Fri Apr 6, 6:05 pm)
Re: coding style for long conditions, Jan Engelhardt, (Fri Apr 6, 6:07 pm)
Re: coding style for long conditions, David Brownell, (Fri Apr 6, 6:43 pm)
Re: coding style for long conditions, Zan Lynx, (Fri Apr 6, 5:50 pm)
Re: coding style for long conditions (WAS: Re: [PATCH 25/90]..., Jeremy Fitzhardinge, (Fri Apr 6, 5:37 pm)
Re: [PATCH 25/90] ARM: OMAP: h4 must have blinky leds!!, Dmitry Torokhov, (Wed Apr 4, 4:42 pm)
Re: [PATCH 25/90] ARM: OMAP: h4 must have blinky leds!!, David Brownell, (Wed Apr 4, 3:13 pm)
[PATCH 27/90] ARM: OMAP: Add minimal OMAP2430 support, Tony Lindgren, (Wed Apr 4, 2:05 pm)
[PATCH 28/90] ARM: OMAP: USB peripheral support on H4, Tony Lindgren, (Wed Apr 4, 2:05 pm)
[PATCH 29/90] ARM: OMAP: Palm Tungsten|T support, Tony Lindgren, (Wed Apr 4, 2:05 pm)
Re: [PATCH 29/90] ARM: OMAP: Palm Tungsten|T support, Pavel Machek, (Fri Apr 6, 8:09 am)
Re: [PATCH 29/90] ARM: OMAP: Palm Tungsten|T support, Russell King, (Sun Apr 8, 8:07 am)
Re: [PATCH 29/90] ARM: OMAP: Palm Tungsten|T support, Pavel Machek, (Sun Apr 8, 8:12 am)
Re: [PATCH 29/90] ARM: OMAP: Palm Tungsten|T support, Russell King, (Sun Apr 8, 10:40 am)
Re: [PATCH 29/90] ARM: OMAP: Palm Tungsten|T support, Pavel Machek, (Mon Apr 9, 7:13 am)
Re: [PATCH 29/90] ARM: OMAP: Palm Tungsten|T support, Russell King, (Sun Apr 8, 9:58 am)
Re: [PATCH 29/90] ARM: OMAP: Palm Tungsten|T support, Dagfinn Ilmari , (Sun Apr 8, 8:31 am)
[PATCH 30/90] ARM: OMAP: Palm Zire71 minor fixes, Tony Lindgren, (Wed Apr 4, 2:05 pm)
[PATCH 31/90] ARM: OMAP: plat-omap changes for 2430 SDP, Tony Lindgren, (Wed Apr 4, 2:05 pm)
[PATCH 32/90] ARM: OMAP: Basic support for siemens sx1, Tony Lindgren, (Wed Apr 4, 2:05 pm)
[PATCH 35/90] ARM: OMAP: speed up gpio irq handling, Tony Lindgren, (Wed Apr 4, 2:05 pm)
[PATCH 36/90] ARM: OMAP: Fix typo in board-h4.h, Tony Lindgren, (Wed Apr 4, 2:05 pm)
[PATCH 37/90] ARM: OMAP: MPUIO wake updates, Tony Lindgren, (Wed Apr 4, 2:05 pm)
[PATCH 38/90] ARM: OMAP: Sync headers with linux-omap, Tony Lindgren, (Wed Apr 4, 2:05 pm)
[PATCH 39/90] ARM: OMAP: Sync core code with linux-omap, Tony Lindgren, (Wed Apr 4, 2:05 pm)
[PATCH 42/90] ARM: OMAP: Tabify mux.c, Tony Lindgren, (Wed Apr 4, 2:05 pm)
[PATCH 43/90] ARM: OMAP: TUSB EVM init, Tony Lindgren, (Wed Apr 4, 2:05 pm)
Re: [PATCH 43/90] ARM: OMAP: TUSB EVM init, Randy Dunlap, (Wed Apr 4, 2:44 pm)
Re: [PATCH 43/90] ARM: OMAP: TUSB EVM init, Tony Lindgren, (Thu Apr 5, 10:42 am)
[PATCH 44/90] ARM: OMAP: Add mailbox support for IVA, Tony Lindgren, (Wed Apr 4, 2:05 pm)
[PATCH 45/90] ARM: OMAP: Update omap h2 defconfig, Tony Lindgren, (Wed Apr 4, 2:05 pm)
[PATCH 46/90] ARM: OMAP: Add omap osk defconfig, Tony Lindgren, (Wed Apr 4, 2:05 pm)
[PATCH 47/90] ARM: OMAP: Fix gpmc header, Tony Lindgren, (Wed Apr 4, 2:05 pm)
[PATCH 48/90] ARM: OMAP: I2C-1 init fix for 2430, Tony Lindgren, (Wed Apr 4, 2:05 pm)
[PATCH 52/90] ARM: OMAP: cleanup apollon board, Tony Lindgren, (Wed Apr 4, 2:05 pm)
[PATCH 53/90] ARM: OMAP: Fix warning in timer32k.c, Tony Lindgren, (Wed Apr 4, 2:05 pm)
Re: [PATCH 53/90] ARM: OMAP: Fix warning in timer32k.c, Randy Dunlap, (Wed Apr 4, 3:14 pm)
Re: [PATCH 53/90] ARM: OMAP: Fix warning in timer32k.c, Tony Lindgren, (Thu Apr 5, 11:15 am)
[PATCH 54/90] ARM: OMAP: Update timer32k.c to compile, Tony Lindgren, (Wed Apr 4, 2:05 pm)
[PATCH 55/90] ARM: OMAP: H3 workqueue fixes, Tony Lindgren, (Wed Apr 4, 2:05 pm)
Re: [PATCH 55/90] ARM: OMAP: H3 workqueue fixes, Tony Lindgren, (Thu Apr 5, 11:17 am)
[PATCH 63/90] ARM: OMAP: Merge PM code from N800 tree, Tony Lindgren, (Wed Apr 4, 2:05 pm)
[PATCH 64/90] ARM: OMAP: Fix warning in pm.c, Tony Lindgren, (Wed Apr 4, 2:05 pm)
Re: [PATCH 64/90] ARM: OMAP: Fix warning in pm.c, Tony Lindgren, (Thu Apr 5, 11:18 am)
[PATCH 69/90] ARM: OMAP: add SoSSI clock, Tony Lindgren, (Wed Apr 4, 2:05 pm)
[PATCH 79/90] ARM: OMAP: fix H4 dependencies again, Tony Lindgren, (Wed Apr 4, 2:05 pm)
[PATCH 80/90] ARM: OMAP: partial LED fixes, Tony Lindgren, (Wed Apr 4, 2:05 pm)
[PATCH 81/90] ARM: OMAP: omap2/pm.c build fix, Tony Lindgren, (Wed Apr 4, 2:06 pm)
[PATCH 82/90] ARM: OMAP: restore CONFIG_GENERIC_TIME, Tony Lindgren, (Wed Apr 4, 2:06 pm)
[PATCH 88/90] ARM: OMAP: OSK led fixes, Tony Lindgren, (Wed Apr 4, 2:06 pm)