From: "Robert P. J. Day" <rpjday@crashcourse.ca>
To: HarryWei <harryxiyou@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: CodingStyle Problem
Date: Sat, 11 Dec 2010 00:53:09 -0500 (EST) [thread overview]
Message-ID: <alpine.DEB.2.00.1012110050060.5069@localhost6.localdomain6> (raw)
In-Reply-To: <20101211053601.GA8683@gmail.com>
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
========================================================================
prev parent reply other threads:[~2010-12-11 5:53 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-11 5:36 HarryWei
2010-12-11 5:53 ` Robert P. J. Day [this message]
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=alpine.DEB.2.00.1012110050060.5069@localhost6.localdomain6 \
--to=rpjday@crashcourse.ca \
--cc=harryxiyou@gmail.com \
--cc=linux-kernel@vger.kernel.org \
/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®