public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Randy Dunlap <randy.dunlap@oracle.com>
To: Jan Engelhardt <jengelh@linux01.gwdg.de>
Cc: lkml <linux-kernel@vger.kernel.org>, akpm <akpm@osdl.org>,
	jesper.juhl@gmail.com
Subject: Re: [PATCH/RFC] CodingStyle updates
Date: Thu, 07 Dec 2006 13:36:44 -0800	[thread overview]
Message-ID: <4578896C.3080504@oracle.com> (raw)
In-Reply-To: <Pine.LNX.4.61.0612071206160.2863@yvahk01.tjqt.qr>

Jan Engelhardt wrote:
> On Dec 7 2006 00:48, Randy Dunlap wrote:
>> +The preferred way to ease multiple indentation levels in a switch
>> +statement is to align the "switch" and its subordinate "case" labels in
>> +the same column instead of "double-indenting" the "case" labels.  E.g.:
>> +
>> +	switch (suffix) {
>> +	case 'G':
>> +	case 'g':
>> +		mem <<= 10;
>> +	case 'M':
>> +	case 'm':
>> +		mem << 10;
>                 ^^^^^^^^^^
> 
> Statement has no effect ;-)

Argh, thanks, fixed these.
And removed most fall-throughs to make it a better example.

>> +Use one space around (on each side of) most binary operators, such as
>> +any of these:
>> +		=  +  -  <  >  *  /  %  |  &  ^  <=  >=  ==  !=
> 
> And the ternary operator ?:

Added.

>> +but no space after unary operators:
>> +		sizeof  ++  --  &  *  +  -  ~  !  defined
> 
> And no space before these unary operators,
> ++ (postincrement) -- (postdecrement)
> 
> What keyword is "defined"? Did you have too much Perl coffee? :)
> 
>> +and no space around the '.' unary operator.
> 
> Same goes for ->

Added.

>> +Linux style for comments is the pre-C99 "/* ... */" style.
> 
> Aka C89.

Changed.

>> +Don't use C99-style "// ..." comments.
>> +
>> +The preferred style for long (multi-line) comments is:
>> +
>> +	/*
>> +	 * This is the preferred style for multi-line
>> +	 * comments in the Linux kernel source code.
>> +	 * Please use it consistently.
>> +	 */
> 
> Description: Stars to the left with two almost blank (/*, */) lines.

Added.

Thanks.  Will resend later today...

-- 
~Randy

  parent reply	other threads:[~2006-12-07 21:36 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-07  8:48 [PATCH/RFC] CodingStyle updates Randy Dunlap
2006-12-07  8:54 ` Jesper Juhl
2006-12-07 11:11 ` Jan Engelhardt
2006-12-07 16:01   ` Chris Friesen
2006-12-07 18:27     ` Jan Engelhardt
2006-12-07 21:36       ` Randy Dunlap
2006-12-07 21:36   ` Randy Dunlap [this message]
2006-12-07 22:54 ` Alistair John Strachan
2006-12-07 23:00   ` Randy Dunlap
2006-12-07 23:06     ` David Miller
2006-12-07 23:15       ` Randy Dunlap
2006-12-07 23:23     ` Jan Engelhardt
2006-12-14 22:38 ` David Weinehall
2006-12-14 22:42   ` Randy Dunlap
2006-12-15  0:07     ` Robert P. J. Day
2006-12-15  0:26       ` Randy Dunlap
2006-12-15  0:44         ` Robert P. J. Day
2006-12-14 23:33 ` Scott Preece
2006-12-14 23:43   ` Randy Dunlap
2006-12-14 23:54     ` Scott Preece

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=4578896C.3080504@oracle.com \
    --to=randy.dunlap@oracle.com \
    --cc=akpm@osdl.org \
    --cc=jengelh@linux01.gwdg.de \
    --cc=jesper.juhl@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /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