Re: [PATCH 07/11] mtd: rawnand: denali: use bool type instead of int where appropriate

From: Masahiro Yamada
Date: Fri Feb 08 2019 - 04:34:42 EST


On Fri, Feb 8, 2019 at 6:24 PM Joe Perches <joe@xxxxxxxxxxx> wrote:
>
> On Fri, 2019-02-08 at 17:08 +0900, Masahiro Yamada wrote:
> > Use 'bool' type for some function arguments.
> >
> > - write (write or read?)
> > - raw (the raw access mode or not?)
> >
> > It is true that denali_nand_info::dma_avail is also boolean, but
> > I am keeping it as 'int' because 'scripts/checkpatch --strict' would
> > report the following:
> >
> > CHECK: Avoid using bool structure members because of possible alignment issues
> > - see: https://lkml.org/lkml/2017/11/21/384
> >
> > I do not think it is a matter here, but I am sticking to the suggestion.
>
> just fyi: that suggestion has been removed by:
>
> commit 7967656ffbfa493f5546c0f18bf8a28f702c4baa
> Author: Jason Gunthorpe <jgg@xxxxxxxx>
> Date: Fri Jan 18 15:50:47 2019 -0700
>
> coding-style: Clarify the expectations around bool
>
> There has been some confusion since checkpatch started warning about bool
> use in structures, and people have been avoiding using it.
>
> Many people feel there is still a legitimate place for bool in structures,
> so provide some guidance on bool usage derived from the entire thread that
> spawned the checkpatch warning.
>
> Link: https://lkml.kernel.org/r/CA+55aFwVZk1OfB9T2v014PTAKFhtVan_Zj2dOjnCy3x


Thanks, this is good to know.


I will use 'bool' for denali_nand_info::dma_avail in v2.

I will wait for other comments until then.





--
Best Regards
Masahiro Yamada