LKML Archive on
help / color / mirror / Atom feed
From: Adrian Bunk <>
To: Jesper Juhl <>
Cc: Randy Dunlap <>,
	Andrew Morton <>,
	LKML <>, Andi Kleen <>,
	Trent Waddington <>,
	Bartlomiej Zolnierkiewicz <>,
	Alan Cox <>
Subject: Re: [PATCH][1/5][resend] floppy.c: Initial (partial) CodingStyle cleanup
Date: Mon, 19 Mar 2007 21:20:08 +0100	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

On Mon, Mar 19, 2007 at 07:18:38PM +0100, Jesper Juhl wrote:
> The second reason is that indenting two tabs seems to make the most sense for 
> a few reasons;  
> 	a) not indenting at all is ugly, plain and simple.
> 		void function(int a, int b,
> 		int c, int d, int e)
> 		{
> 			int foo;
> 			int bar;
> 		...
> 		}
> 	b) indenting only one tab stop puts parameters at the same indent level as
> 	   variables in the function which is potentially confusing (at least IMHO).
> 		void function(int a, int b,
> 			int c, int d, int e)
> 		{
> 			int foo;
> 			int bar;
> 		...
> 		}
> 	c) Indenting so that all parameter lines start at the opening paranthesis 
> 	   rarely matches up with tabs so you have to use varying amounts of spaces
> 	   depending on how long the function name is. Not a good solution IMHO.
> 		void function(int a, int b,
> 				     int c, int d, int e)

Your example is wrong, it's:

               void function(int a, int b,
                             int c, int d, int e)

This is the most common convention in the kernel - and except for 
extremely long function names it's the one with the best readability.

Yes, it's a problem with extremely long function names, but they are 
rare in the kernel.

And the "varying amounts of spaces" should be handled automatically by 
your editor.



       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed

  reply	other threads:[~2007-03-19 20:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-19 15:10 Jesper Juhl
2007-03-19 15:31 ` Randy Dunlap
2007-03-19 18:18   ` Jesper Juhl
2007-03-19 20:20     ` Adrian Bunk [this message]
2007-03-19 22:25       ` Jesper Juhl

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \ \ \
    --subject='Re: [PATCH][1/5][resend] floppy.c: Initial (partial) CodingStyle cleanup' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).