[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1365668975.1929.4.camel@joe-AO722>
Date: Thu, 11 Apr 2013 01:29:35 -0700
From: Joe Perches <joe@...ches.com>
To: Dan Carpenter <dan.carpenter@...cle.com>
Cc: Dave Jones <davej@...hat.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Andy Whitcroft <apw@...dowen.org>,
LKML <linux-kernel@...r.kernel.org>,
Jacob Pan <jacob.jun.pan@...ux.intel.com>
Subject: Re: [PATCH] checkpatch: Warn on comparisons to true and false
On Thu, 2013-04-11 at 11:19 +0300, Dan Carpenter wrote:
> On Wed, Apr 10, 2013 at 10:14:15PM -0400, Dave Jones wrote:
> > It would be interesting to see how many people have historically screwed
> > up and used (!a) when they mean (a) and vice versa, versus spelling
> > it out longform. I'd be surprised if the results weren't skewed
> > in favour of the more verbose form.
>
> I see a the occasional reversed test in Smatch but normally these
> kind of bugs are detected with basic testing so they are rare.
I'd guess the most common error would be using
an int comparison when the value is not 0 or 1.
Non-zero is still "true" but isn't == true.
--
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