lkml.org 
[lkml]   [2017]   [Oct]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [f2fs-dev] [PATCH] f2fs: Fix bool initialization/comparison
From
Date
On 2017/10/8 3:30, Joe Perches wrote:
> 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.

Yes, that's just cleanup.

Hi Thomas, could you change the commit message a bit?

>
>> On Sat, Oct 7, 2017 at 11:02 PM, Thomas Meyer <thomas@m3y3r.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 */

Comment should be updated too.

Thanks,

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

\
 
 \ /
  Last update: 2017-10-09 03:49    [W:0.146 / U:0.992 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site