lkml.org 
[lkml]   [2014]   [Apr]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 1/1] fs/xfs/xfs_log.c: Fix comparison to bool
From
Date
On Wed, 2014-04-16 at 15:15 -0700, Andrew Morton wrote:
> On Sun, 13 Apr 2014 22:09:17 +0200 Fabian Frederick <fabf@skynet.be> 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.



\
 
 \ /
  Last update: 2014-04-17 01:01    [from the cache]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and my Meterkast|Read the blog