All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Nicolas Morey Chaisemartin <nmorey@kalray.eu>
Cc: Viresh Kumar <viresh.kumar@linaro.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Dan Carpenter <dan.carpenter@oracle.com>,
	Greg KH <gregkh@linuxfoundation.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Mike Holmes <mike.holmes@linaro.org>
Subject: Re: [PATCH] checkpatch: add --strict "pointer comparison to NULL" test
Date: Thu, 27 Aug 2015 00:22:39 -0700	[thread overview]
Message-ID: <1440660159.11525.79.camel@perches.com> (raw)
In-Reply-To: <975828790.5069815.1440659347329.JavaMail.zimbra@kalray.eu>

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.



  reply	other threads:[~2015-08-27  7:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-13 18:57 [PATCH] checkpatch: add --strict "pointer comparison to NULL" test Joe Perches
2015-08-27  2:19 ` Viresh Kumar
2015-08-27  3:05   ` Joe Perches
2015-08-27  7:09     ` Nicolas Morey Chaisemartin
2015-08-27  7:22       ` Joe Perches [this message]
2015-08-27 17:33         ` [PATCH] checkpatch: add constant comparison on left side test Joe Perches

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=1440660159.11525.79.camel@perches.com \
    --to=joe@perches.com \
    --cc=akpm@linux-foundation.org \
    --cc=dan.carpenter@oracle.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mike.holmes@linaro.org \
    --cc=nmorey@kalray.eu \
    --cc=viresh.kumar@linaro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.