Re: [Cocci] Re: [PATCH] scripts/coccinelle/misc/boolinit.cocci:semantic patch for bool issues

From: Joe Perches
Date: Fri Feb 10 2012 - 13:51:20 EST


On Fri, 2012-02-10 at 20:44 +0200, Artem Bityutskiy wrote:
> On Fri, 2012-02-10 at 09:45 -0800, Joe Perches wrote:
> > On Fri, 2012-02-10 at 18:11 +0100, Julia Lawall wrote:
> > > From: Julia Lawall <Julia.Lawall@xxxxxxx>
> > Thanks Julia. It seems to work well.
> I wonder though, why would we want to change if (a == true) with if (a)
> etc? Julia did not provide the explanation in the commit message but
> referred to you and Rusty in the semantic patch.

Testing booleans against specific values is poor form.
booleans should be tested or !tested.

If you are going to submit these patches,
I suggest you break them out by 2nd level
directory.

patch 1: drivers/foo/...
patch 2: drivers/bar/...
...
patch n: drivers/baz/...

and cc: trivial@xxxxxxxxxx

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