From: Dan Carpenter <dan.carpenter@oracle.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Quentin Lambert <lambert.quentin@gmail.com>,
devel@driverdev.osuosl.org, sparmaintainer@unisys.com,
kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org,
Benjamin Romer <benjamin.romer@unisys.com>,
David Kershner <david.kershner@unisys.com>
Subject: Re: [PATCH 1/1] staging: unisys: Remove allocation from declaration line
Date: Wed, 11 Feb 2015 10:23:07 +0000 [thread overview]
Message-ID: <20150211102306.GB26542@mwanda> (raw)
In-Reply-To: <20150210222627.GC27072@kroah.com>
On Wed, Feb 11, 2015 at 06:26:27AM +0800, Greg Kroah-Hartman wrote:
> On Tue, Feb 10, 2015 at 02:02:14PM +0100, Quentin Lambert wrote:
> > This patch removes allocation from declaration line because
> > people are known to gloss over declarations.
>
> Again, who are these lazy people, and why are they reading kernel code?
>
From my work with smatch:
1) Probably 70-80% of inconsistent NULL checking is when done in the
initializer. I'm sending a patch for one of these today.
2) If there is an allocation in the initializer then it's more likely
that the NULL check will be missing.
Initializers are a blind spot that people do not read. It's not just
one maintainer, it's consistent across the board.
Also if you put an allocation in the initializer then it almost always
has to be mangled to fit in 80 characters and it looks ugly. But after
these patches then all the allocations fit naturally.
Plus you have to have that blank line to separate the initialization
paragraph from the paragraph with the check for allocation failure.
Really, it is fairly uncommon to put an allocation in the initalizer.
regards,
dan carpenter
next prev parent reply other threads:[~2015-02-11 10:23 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-10 13:02 [PATCH 1/1] staging: unisys: Remove allocation from declaration line Quentin Lambert
2015-02-10 13:55 ` Sudip Mukherjee
2015-02-10 22:26 ` Greg Kroah-Hartman
2015-02-11 10:23 ` Dan Carpenter [this message]
2015-02-12 12:22 ` Quentin Lambert
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=20150211102306.GB26542@mwanda \
--to=dan.carpenter@oracle.com \
--cc=benjamin.romer@unisys.com \
--cc=david.kershner@unisys.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=lambert.quentin@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sparmaintainer@unisys.com \
/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;
as well as URLs for NNTP newsgroup(s).