Re: [PATCH 1/1] fs/xfs/xfs_log.c: Fix comparison to bool

From: Joe Perches
Date: Wed Apr 16 2014 - 18:48:09 EST


On Wed, 2014-04-16 at 15:15 -0700, Andrew Morton wrote:
> On Sun, 13 Apr 2014 22:09:17 +0200 Fabian Frederick <fabf@xxxxxxxxx> wrote:
> > Fixing coccinelle warning
[]
> > @@ -2376,7 +2376,7 @@ next_lv:
[]
> > - if (record_cnt == 0 && ordered == false) {
> > + if (record_cnt == 0 && !ordered) {
[]
> There was nothing wrong with that code. I suspect coccinelle bustage.

Not really.

It's more a conceit that consistent uses of direct
boolean variable tests are less likely to be error
prone than variable comparisons to boolean literals.

Many style guides, CodingStyle not included, suggest
avoiding comparisons to boolean literals.

There is a checkpatch --strict message when comparing
a literal true/false.

I tend not to change these unless there are multiple
styles in the same subsystem/file.

--
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/