lkml.org 
[lkml]   [2022]   [Jul]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 5/6] mtd: spi-nor: add generic flash driver
Hi,

>> +
>> + /* Fallback to a generic flash described only by its SFDP data. */
>> + if (!info) {
>> + ret = spi_nor_check_sfdp_signature(nor);
>> + if (!ret)
>> + info = &spi_nor_generic_flash;
>> + }
>
> May be this can be combined as
>
> if (!info && (!spi_nor_check_sfdp_signature(nor)))
> info = &spi_nor_generic_flash;

While this is the behavior, I don't like (1) calling functions
in the condition and (2) rely on the && and || semantics, i.e.
to just call the second part if the first is true/false.

-michael

\
 
 \ /
  Last update: 2022-07-21 11:49    [W:0.127 / U:0.380 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site