public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "S. Gilles" <sgilles@math.umd.edu>
To: Joe Perches <joe@perches.com>
Cc: "S. Gilles" <sgilles@math.umd.edu>,
	Andy Whitcroft <apw@canonical.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] checkpatch: detect leading * in NULL comparison check
Date: Sun, 13 Dec 2015 17:02:54 -0500	[thread overview]
Message-ID: <20151213220254.GA26291@number16> (raw)
In-Reply-To: <1450039741.20678.7.camel@perches.com>

On 2015-12-13T12:49:01, Joe Perches wrote:
> On Sun, 2015-12-13 at 12:59 -0500, S. Gilles wrote:
> > Prevent checkpatch.pl from emitting messages like
> > 
> >   CHECK: Comparison to NULL could be written "!rx_p"
> >   #51: FILE: drivers/staging/iio/accel/sca3000_ring.c:51:
> >   +       if (*rx_p == NULL) {
> > 
> > by checking for leading * characters in the comparison value.
> > 
> > Signed-off-by: S. Gilles <sgilles@math.umd.edu>
> > ---
> > 
> > I've run this through everything in staging/ as a test, it seems to
> > work okay.
> 
> This wouldn't work with
> 
> 	* foo == NULL;
> 
> but there don't seem to be any in the kernel source.

Some other stuff like

	*(foo) == NULL

won't be caught as well, but in such false negative cases, other style
conventions would have to be violated anyway. I'm not sure how strong
that argument is.

-- 
S. Gilles

      reply	other threads:[~2015-12-13 22:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-13 17:59 [PATCH] checkpatch: detect leading * in NULL comparison check S. Gilles
2015-12-13 20:49 ` Joe Perches
2015-12-13 22:02   ` S. Gilles [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=20151213220254.GA26291@number16 \
    --to=sgilles@math.umd.edu \
    --cc=apw@canonical.com \
    --cc=joe@perches.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