lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1507404632.27502.5.camel@perches.com>
Date:   Sat, 07 Oct 2017 12:30:32 -0700
From:   Joe Perches <joe@...ches.com>
To:     Ju Hyung Park <qkrwngud825@...il.com>,
        Thomas Meyer <thomas@...3r.de>
Cc:     "jaegeuk@...nel.org" <jaegeuk@...nel.org>,
        Chao Yu <yuchao0@...wei.com>,
        linux-f2fs-devel@...ts.sourceforge.net,
        linux-kernel@...r.kernel.org
Subject: Re: [f2fs-dev] [PATCH] f2fs: Fix bool initialization/comparison

On Sat, 2017-10-07 at 23:33 +0900, Ju Hyung Park wrote:
> Isn't this bogus?
> 
> "bool" type in Linux kernel is a typedef to "_Bool"
> and true/false is defined as 1 and 0 by enum at include/linux/stddef.h.

Bogus?  Well, not really.  It's just a neatening and it's
identical object code.

The idea is that true/false is more intelligible than 1/0
for a human reader.

> On Sat, Oct 7, 2017 at 11:02 PM, Thomas Meyer <thomas@...3r.de> wrote:
> > Bool initializations should use true and false. Bool tests don't need
> > comparisons.
[]
> > diff -u -p a/fs/f2fs/data.c b/fs/f2fs/data.c
[]
> > @@ -419,7 +419,7 @@ next:
> >         bio_page = fio->encrypted_page ? fio->encrypted_page : fio->page;
> > 
> >         /* set submitted = 1 as a return value */
> > -       fio->submitted = 1;
> > +       fio->submitted = true;
> > 
> >         inc_page_count(sbi, WB_DATA_TYPE(bio_page));
> > 

And it's probably better to change the comment too.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ