[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e6b22ad3b427770625aa56a4fe700e5c@walle.cc>
Date: Thu, 21 Jul 2022 11:48:02 +0200
From: Michael Walle <michael@...le.cc>
To: Biju Das <biju.das.jz@...renesas.com>
Cc: linux-kernel@...r.kernel.org, linux-mtd@...ts.infradead.org,
miquel.raynal@...tlin.com, p.yadav@...com, richard@....at,
tudor.ambarus@...rochip.com, vigneshr@...com
Subject: Re: [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
Powered by blists - more mailing lists