lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20070319202008.GY752@stusta.de>
Date:	Mon, 19 Mar 2007 21:20:08 +0100
From:	Adrian Bunk <bunk@...sta.de>
To:	Jesper Juhl <jesper.juhl@...il.com>
Cc:	Randy Dunlap <randy.dunlap@...cle.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	LKML <linux-kernel@...r.kernel.org>, Andi Kleen <ak@...e.de>,
	Trent Waddington <trent.waddington@...il.com>,
	Bartlomiej Zolnierkiewicz <bzolnier@...il.com>,
	Alan Cox <alan@...rguk.ukuu.org.uk>
Subject: Re: [PATCH][1/5][resend] floppy.c: Initial (partial) CodingStyle cleanup

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.

cu
Adrian

-- 

       "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

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ