[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20151213220254.GA26291@number16>
Date: Sun, 13 Dec 2015 17:02:54 -0500
From: "S. Gilles" <sgilles@...h.umd.edu>
To: Joe Perches <joe@...ches.com>
Cc: "S. Gilles" <sgilles@...h.umd.edu>,
Andy Whitcroft <apw@...onical.com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] checkpatch: detect leading * in NULL comparison check
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@...h.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
--
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