Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1214365

Re: [PATCH] checkpatch: add --strict "pointer comparison to NULL" test

From Joe Perches <joe@perches.com>
Newsgroups linux.kernel
Subject Re: [PATCH] checkpatch: add --strict "pointer comparison to NULL" test
Date 2015-08-27 09:30 +0200
Message-ID <q1ZNg-60L-15@gated-at.bofh.it> (permalink)
References <om7MC-7Ks-7@gated-at.bofh.it> <q1UXf-7A4-17@gated-at.bofh.it> <q1VJD-gX-3@gated-at.bofh.it> <q1ZDz-5Pa-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, 2015-08-27 at 09:09 +0200, Nicolas Morey Chaisemartin wrote:
> > From: "Joe Perches" <joe@perches.com>
[]
> > And because most likely, "CONST test variable" checks like
> > 	NULL != foo
> > and
> > 	0 < bar
> > 
> > should probably be a separate test.
[]
> > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
[]
> > +				if ($comp eq "<") {
> > +					$newcomp = ">=";
> > +				} elsif ($comp eq "<=") {
> > +					$newcomp = ">";
> > +				} elsif ($comp eq ">") {
> > +					$newcomp = "<=";
> > +				} elsif ($comp eq ">=") {
> > +					$newcomp = "<";
> > +				}
> 
> I like the concept but are you sure about this?
> I think the "=" should be added or removed. If a < b, b > a, not b >= a.

Right thanks, it's obviously incorrect.


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH] checkpatch: add --strict "pointer comparison to NULL" test Viresh Kumar <viresh.kumar@linaro.org> - 2015-08-27 04:20 +0200
  Re: [PATCH] checkpatch: add --strict "pointer comparison to NULL"  test Joe Perches <joe@perches.com> - 2015-08-27 05:10 +0200
    Re: [PATCH] checkpatch: add --strict "pointer comparison to NULL"  test Nicolas Morey Chaisemartin <nmorey@kalray.eu> - 2015-08-27 09:20 +0200
      Re: [PATCH] checkpatch: add --strict "pointer comparison to NULL"  test Joe Perches <joe@perches.com> - 2015-08-27 09:30 +0200
        [PATCH] checkpatch: add constant comparison on left side test Joe Perches <joe@perches.com> - 2015-08-27 19:40 +0200

csiph-web