From: WANG Cong <xiyou.wangcong@gmail.com>
To: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: Jeff Garzik <jeff@garzik.org>,
Randy Dunlap <rdunlap@xenotime.net>,
Al Viro <viro@ftp.linux.org.uk>,
LKML <linux-kernel@vger.kernel.org>,
akpm@linux-foundation.org, Chen Li-jun <cljun@xiyou.edu.cn>,
Wang Ya-gang <lazy_linux@126.com>
Subject: [RFC] Documentation/CodingStyle: Add rules for goto labels (-v2)
Date: Mon, 4 Jun 2007 16:19:38 +0800 [thread overview]
Message-ID: <20070604081938.GC2074@localhost.localdomain> (raw)
In-Reply-To: <4663B84E.2060103@goop.org>
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.
next prev parent reply other threads:[~2007-06-04 8:19 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` WANG Cong [this message]
2007-06-04 18:30 ` [RFC] Documentation/CodingStyle: Add rules for goto labels (-v2) 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070604081938.GC2074@localhost.localdomain \
--to=xiyou.wangcong@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=cljun@xiyou.edu.cn \
--cc=jeff@garzik.org \
--cc=jeremy@goop.org \
--cc=lazy_linux@126.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rdunlap@xenotime.net \
--cc=viro@ftp.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox