linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nicolas Ferre <nicolas.ferre@atmel.com>
To: Russell King - ARM Linux <linux@arm.linux.org.uk>
Cc: Phil Carmody <pc+lkml@asdf.org>,
	linux-samsung-soc@vger.kernel.org, linux-omap@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: IS_ERR_OR_NULL - please STOP telling people to use this on a whim
Date: Thu, 18 Oct 2012 09:22:58 +0200	[thread overview]
Message-ID: <507FAE52.6060305@atmel.com> (raw)
In-Reply-To: <20121017213342.GA28061@n2100.arm.linux.org.uk>

On 10/17/2012 11:33 PM, Russell King - ARM Linux :
> On Wed, Oct 17, 2012 at 11:28:48PM +0300, Phil Carmody wrote:
>> So, what to do? It can and has been used sensibly, so I don't think removing
>> it is the best option.
> 
> Well, the first thing that needs to be done is a full review of every user
> and fixes applied.
> 
> The second thing is that we need eyes on code _and_ review comments, and
> educate those who are telling people to use IS_ERR_OR_NULL() whenever they
> see an IS_ERR() to think about the code a little more - that's kind of the
> purpose of my email.
> 
> Unfortunately, it's going to take time to achieve a change, and if I end
> up being the only one who's spotting these errors, I'm going to get
> incredibly pissed off at doing so (because it will feel like I'm being
> ignored when there's a constant stream of it.)
> 
> Another thing would be to work out whether we can get checkpatch to
> detect usage of IS_ERR_OR_NULL(p) followed by PTR_ERR(p) without any
> explicit NULL checks against p in the same block.  That's probably
> going to be interesting to code up in perl.

True that it would make sense to include in checkpatch to be able to
block code beforehand.
But for sure correction of existing code seems to be a work for Coccinelle.

Best regards,
-- 
Nicolas Ferre

      reply	other threads:[~2012-10-18  7:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-17 19:41 IS_ERR_OR_NULL - please STOP telling people to use this on a whim Russell King - ARM Linux
2012-10-17 20:28 ` Phil Carmody
2012-10-17 21:33   ` Russell King - ARM Linux
2012-10-18  7:22     ` Nicolas Ferre [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=507FAE52.6060305@atmel.com \
    --to=nicolas.ferre@atmel.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=pc+lkml@asdf.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;
as well as URLs for NNTP newsgroup(s).