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: <20080326111021.GF17176@elte.hu>
Date:	Wed, 26 Mar 2008 12:10:21 +0100
From:	Ingo Molnar <mingo@...e.hu>
To:	Al Viro <viro@...IV.linux.org.uk>
Cc:	J?rn Engel <joern@...fs.org>, David Miller <davem@...emloft.net>,
	jirislaby@...il.com, joe@...ches.com, tglx@...utronix.de,
	linux-kernel@...r.kernel.org, Andy Whitcroft <apw@...dowen.org>
Subject: Re: [patch] bkl2mtd: cleanup


* Al Viro <viro@...IV.linux.org.uk> wrote:

> > -static int _block2mtd_write(struct block2mtd_dev *dev, const u_char *buf,
> > -		loff_t to, size_t len, size_t *retlen)
> > +static int
> > +_block2mtd_write(struct block2mtd_dev *dev, const u_char *buf, loff_t to,
> > +		 size_t len, size_t *retlen)
> 
> That's actually worse...  BTW, single-underscore-... for identifiers?  
> Odd.

(yep, that's odd.)

> > -static int block2mtd_write(struct mtd_info *mtd, loff_t to, size_t len,
> > +static int
> > +block2mtd_write(struct mtd_info *mtd, loff_t to, size_t len,
> >  		size_t *retlen, const u_char *buf)
> 
> Again, why split it that way?

these are really nuances, so unless you are interested in such nuances 
nowhere found in CodingStyle, stop reading here :-)

i personally try to minimize the number and complexity of function 
prototype patterns, while still trying to keep the linecount low. So if 
a function prototype wants to be multi-line, it's not a "simple one-line 
function prototype" anymore, so i use the same template for everything:

 type
 function_name(vars ...
               more vars ...)
 {

[ having the 'type' separately makes it easy to judge the return type of 
  a function (especially with syntax highlighting active). Aligned 
  variables are an efficient extension of the 'line' concept that does 
  not mix the function_name with the variables. ]

incidentally, a natural simplified variant of that is the following:

 type
 function_name(vars...)
 {

which tends to stay cleanly 2-line and looks tidier and shorter than 
the:

 type function_name(vars...
                    more vars ...)
 {

form. The preferred form is of course:

 type function_name(vars...)

	Ingo
--
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