public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC] Documentation/CodingStyle: Add rules for goto labels
@ 2007-06-03 14:24 WANG Cong
  2007-06-03 14:29 ` Al Viro
  0 siblings, 1 reply; 27+ messages in thread
From: WANG Cong @ 2007-06-03 14:24 UTC (permalink / raw)
  To: LKML; +Cc: rdunlap, akpm, Chen Li-jun, Wang Ya-gang


There are many people use Lindent to indent their code, but 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.

Any advice or comments are more than welcome!

Regards!

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

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

--- linux-2.6.22-rc3/Documentation/CodingStyle.orig	2007-06-03 21:28:19.000000000 +0800
+++ linux-2.6.22-rc3/Documentation/CodingStyle	2007-06-03 21:51:21.000000000 +0800
@@ -66,6 +66,12 @@ 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. A goto label should be aligned in the column that is 8
+characters ahead of the statement just below this 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.
 

^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2007-06-10  2:32 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-03 14:24 [RFC] Documentation/CodingStyle: Add rules for goto labels WANG Cong
2007-06-03 14:29 ` Al Viro
2007-06-03 14:45   ` Randy Dunlap
2007-06-03 15:35     ` Jeff Garzik
2007-06-04  4:58       ` WANG Cong
2007-06-04  6:59         ` Jeremy Fitzhardinge
2007-06-04  7:51           ` WANG Cong
2007-06-04  8:19           ` [RFC] Documentation/CodingStyle: Add rules for goto labels (-v2) WANG Cong
2007-06-04 18:30             ` Sam Ravnborg
2007-06-04 19:02               ` Jeremy Fitzhardinge
2007-06-05  1:37                 ` WANG Cong
2007-06-10  2:31                   ` Al Viro
2007-06-04 17:27           ` [RFC] Documentation/CodingStyle: Add rules for goto labels H. Peter Anvin
2007-06-04 19:00             ` Jeremy Fitzhardinge
2007-06-04 21:34               ` H. Peter Anvin
2007-06-04 17:27       ` H. Peter Anvin
2007-06-04 17:35         ` Jan Engelhardt
2007-06-04 17:43           ` H. Peter Anvin
2007-06-04 17:54             ` Valdis.Kletnieks
2007-06-04 18:01               ` H. Peter Anvin
2007-06-04 17:57             ` Jeff Garzik
2007-06-05  2:10               ` WANG Cong
2007-06-05  2:12                 ` Jeff Garzik
2007-06-05  2:31                   ` H. Peter Anvin
2007-06-05  7:44                     ` WANG Cong
2007-06-05  9:16                 ` Rene Herman
2007-06-06  4:53                   ` WANG Cong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox