mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Randy.Dunlap" <rdunlap@xenotime.net>
To: Pavel Machek <pavel@ucw.cz>
Cc: Takashi Iwai <tiwai@suse.de>, Andrew Morton <akpm@osdl.org>,
	kernel list <linux-kernel@vger.kernel.org>,
	perex@suse.cz, alsa-devel@alsa-project.org, pshou@realtek.com.tw
Subject: Re: CodingStyle (was: Re: sound/pci/hda/intel_hda: small cleanups)
Date: Tue, 5 Sep 2006 08:43:52 -0700	[thread overview]
Message-ID: <20060905084352.1ced999e.rdunlap@xenotime.net> (raw)
In-Reply-To: <20060905080813.GE1958@elf.ucw.cz>

On Tue, 5 Sep 2006 10:08:14 +0200 Pavel Machek wrote:

> Hi!
> 
> > > > So, just this morning I have seen questions and opinions about
> > > > the following that could (or could not) use more documentation
> > > > or codification and I'm sure that we could easily find more,
> > > > but do we want to codify Everything??
> > > > 
> > > > 
> > > > 1.  Kconfig help text should be indented (it's not indented in the
> > > > 	GFS2 patches)
> 
> Chapter 10 speaks about that alread?

OK, good.
I had only looked in Documentation/kbuild/kconfig-language.txt.


> > > > 2.  if (!condition1)	/* no space between ! and condition1
> */
> > > > 3.  don't use C99-style // comments
> > > > 4.  unsigned int bitfield :<nr_bits>;
> 
> Ok.
> 
> > > Looks reasonable to me. Will you do the patch or should I ?
> > 
> > Please (you) go ahead with it.
> 
> Does it look okay?
> 
> Signed-off-by: Pavel Machek <pavel@suse.cz>
> 
> diff --git a/Documentation/CodingStyle b/Documentation/CodingStyle
> index 6d2412e..d8e51a6 100644
> --- a/Documentation/CodingStyle
> +++ b/Documentation/CodingStyle
> @@ -46,6 +46,16 @@ used for indentation, and the above exam
>  
>  Get a decent editor and don't leave whitespace at the end of lines.
>  
> +Bitfield variables should be indented like this:
> +
> +	unsigned int foo :1;
> +
> +Avoid extra spaces around ! operator, and do not place spaces around (s.

I would spell out "parentheses".

> +	if (!buffer)
> +
> +is okay, if ( ! buffer ) is just ugly.	
> +
>  
>  		Chapter 2: Breaking long lines and strings
>  
> @@ -280,7 +290,7 @@ int fun(int a)
>  	int result = 0;
>  	char *buffer = kmalloc(SIZE);
>  
> -	if (buffer == NULL)
> +	if (!buffer)
>  		return -ENOMEM;
>  
>  	if (condition1) {
> @@ -316,6 +326,9 @@ When commenting the kernel API functions
>  See the files Documentation/kernel-doc-nano-HOWTO.txt and scripts/kernel-doc
>  for details.
>  
> +Please do not use C99-style comments, and do not use comments to
                              ^
I would insert:               "// "

> +comment out unused code.
> +

Is there an acceptable way to leave source code in a file but
render it unused?  Like #if 0/#endif or #if BOGUS_SYMBOL/#endif ?


>  		Chapter 9: You've made a mess of it
>  
>  That's OK, we all do.  You've probably been told by your long-time Unix


---
~Randy

  parent reply	other threads:[~2006-09-05 15:40 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-31 12:37 sound/pci/hda/intel_hda: small cleanups Pavel Machek
2006-08-31 13:01 ` Takashi Iwai
2006-08-31 13:39   ` Pavel Machek
2006-08-31 14:53     ` Takashi Iwai
2006-08-31 22:29       ` Pavel Machek
2006-08-31 18:04   ` CodingStyle (was: Re: sound/pci/hda/intel_hda: small cleanups) Randy.Dunlap
2006-09-02 23:15     ` Pavel Machek
2006-09-03  4:30       ` Randy.Dunlap
2006-09-05  8:08         ` Pavel Machek
2006-09-05 15:26           ` Takashi Iwai
2006-09-05 15:43           ` Randy.Dunlap [this message]
2006-09-06  7:23             ` Ingo Oeser
2006-09-06 13:51             ` Pavel Machek
2006-09-06 22:22               ` Chase Venters
2006-09-05 16:40           ` CodingStyle Stefan Richter

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=20060905084352.1ced999e.rdunlap@xenotime.net \
    --to=rdunlap@xenotime.net \
    --cc=akpm@osdl.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=perex@suse.cz \
    --cc=pshou@realtek.com.tw \
    --cc=tiwai@suse.de \
    /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

all inboxes | Powered by JetHome®