[RFC] Documentation/CodingStyle: Add rules for goto labels (-v2)

WANG Cong
2007-06-04T08:19:19Z

Lindent gets wrong when it meets goto labels. This should be fixed manually.
And kernel's CodingStyle doesn't specify the indentation for goto labels explicitly.

This patch adds specifications on those things about goto labels in CodingStyle. And it is
against -rc3 source tree.

Thanks to Al Viro, Randy Dunlap, Jeff Garzik and Jeremy Fitzhardinge for their comments!

Regards!

Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>

---
CodingStyle | 7 +++++++
1 file changed, 7 insertions(+)

--- linux-2.6.22-rc3/Documentation/CodingStyle.orig 2007-06-04 15:53:58.000000000 +0800
+++ linux-2.6.22-rc3/Documentation/CodingStyle 2007-06-04 16:04:31.000000000 +0800
@@ -66,6 +66,13 @@ something to hide:
Don't put multiple assignments on a single line either. Kernel coding style
is super simple. Avoid tricky expressions.

+Do care when you use Lindent to indent your code, since it may use spaces
+instead of tabs before a goto label and it may also align the label in a
+wrong position. Generally speaking, a goto label should be always aligned in
+the first column. However, it might make sense to indent a label deeper if
+you've actually declared it local (__label__). Please fix it manually if you
+find Lindent is wrong.
+
Outside of comments, documentation and except in Kconfig, spaces are never
used for indentation, and the above example is deliberately broken.