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] [day] [month] [year] [list]
Date:	Sat, 11 Dec 2010 00:53:09 -0500 (EST)
From:	"Robert P. J. Day" <rpjday@...shcourse.ca>
To:	HarryWei <harryxiyou@...il.com>
cc:	linux-kernel@...r.kernel.org
Subject: Re: CodingStyle Problem

On Sat, 11 Dec 2010, HarryWei wrote:

> Hi all,
>       I just read the CodingSyle at Documentation directory in linux-2.6.23 kernel source code.
>       But a problem happened to me like following.
>       Functions in linux-2.6.23/fs/fs-writeback.c are "static int" and function name are in different lines.(function name in following line)
>       I can't find the rule in CodingStyle. That We often program functions are "static int" and function name are in the same line.
>       When do we do the first or second way? What is different between them?
>
>   Any answer is okay.
>   Best regards.

  the advantage to the form

static int
function-name

is that, if you're looking for the actual function *definition* in the
file, having the function name at the start of a new line means you
can search for it with the pattern "^function-name" so that you don't
have to wade through all of the invocations of that function.

  i like that style; others claim that with proper cross-referencers
like cscope, doing that is redundant.  as far as i know, the kernel
coding style doesn't take a position on that, but i'm willing to be
corrected.

rday

-- 

========================================================================
Robert P. J. Day                               Waterloo, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================
--
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