[PATCH 02/10] mtd: add a helper to check the SLC/MLC nand chip

Brian Norris computersforpeace at gmail.com
Mon Aug 12 22:52:49 EDT 2013


On Mon, Aug 12, 2013 at 7:35 PM, Huang Shijie <b32955 at freescale.com> wrote:
> 于 2013年08月13日 08:52, Brian Norris 写道:
>>>
>>> -       if (denali->nand.cellinfo&  NAND_CI_CELLTYPE_MSK&&
>>> >  +    if (!nand_is_slc(&denali->nand)&&
>>
>> According to my recommendations in patch 1, this would only need to be:
>>
>>    if (denali->nand.bits_per_cell>  1&&  ...)
>>
>>
>> IMO, that is plenty readable, then we don't need the helper.
>
> The drivers may also check the SLC/MLC.
>
> IMO, using a helper is more readable :)

OK, the helper is still fine. I just thought that bits_per_cell has
direct meaning in itself (whereas "cellinfo & NAND_CI_CELLTYPE_MSK"
doesn't).

Brian



More information about the linux-mtd mailing list