From: Michael Walle <michael@walle.cc>
To: Biju Das <biju.das.jz@bp.renesas.com>
Cc: linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org,
miquel.raynal@bootlin.com, p.yadav@ti.com, richard@nod.at,
tudor.ambarus@microchip.com, vigneshr@ti.com
Subject: Re: [PATCH 5/6] mtd: spi-nor: add generic flash driver
Date: Thu, 21 Jul 2022 11:48:02 +0200 [thread overview]
Message-ID: <e6b22ad3b427770625aa56a4fe700e5c@walle.cc> (raw)
In-Reply-To: <202205132220.uRTFaqNA-lkp@intel.com> (raw)
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
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
WARNING: multiple messages have this Message-ID (diff)
From: Michael Walle <michael@walle.cc>
To: Biju Das <biju.das.jz@bp.renesas.com>
Cc: linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org,
miquel.raynal@bootlin.com, p.yadav@ti.com, richard@nod.at,
tudor.ambarus@microchip.com, vigneshr@ti.com
Subject: Re: [PATCH 5/6] mtd: spi-nor: add generic flash driver
Date: Thu, 21 Jul 2022 11:48:02 +0200 [thread overview]
Message-ID: <e6b22ad3b427770625aa56a4fe700e5c@walle.cc> (raw)
In-Reply-To: <202205132220.uRTFaqNA-lkp@intel.com> (raw)
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
next prev parent reply other threads:[~2022-07-21 9:48 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-13 13:35 [PATCH 0/6] mtd: spi-nor: generic flash driver Michael Walle
2022-05-13 13:35 ` Michael Walle
2022-05-13 13:35 ` [PATCH 1/6] mtd: spi-nor: hide jedec_id sysfs attribute if not present Michael Walle
2022-05-13 13:35 ` Michael Walle
2022-07-26 10:00 ` Takahiro Kuwano
2022-07-26 10:00 ` Takahiro Kuwano
2022-05-13 13:35 ` [PATCH 2/6] mtd: spi-nor: sysfs: hide manufacturer if it is not set Michael Walle
2022-05-13 13:35 ` Michael Walle
2022-07-26 10:04 ` Takahiro Kuwano
2022-07-26 10:04 ` Takahiro Kuwano
2022-05-13 13:35 ` [PATCH 3/6] mtd: spi-nor: remember full JEDEC flash ID Michael Walle
2022-05-13 13:35 ` Michael Walle
2022-07-29 1:00 ` Takahiro Kuwano
2022-07-29 1:00 ` Takahiro Kuwano
2022-05-13 13:35 ` [PATCH 4/6] mtd: spi-nor: move function declaration out of sfdp.h Michael Walle
2022-05-13 13:35 ` Michael Walle
2022-07-26 23:41 ` Takahiro Kuwano
2022-07-26 23:41 ` Takahiro Kuwano
2022-05-13 13:35 ` [PATCH 5/6] mtd: spi-nor: add generic flash driver Michael Walle
2022-05-13 13:35 ` Michael Walle
2022-05-13 14:47 ` kernel test robot
2022-07-21 9:32 ` Biju Das
2022-07-21 9:32 ` Biju Das
2022-05-13 14:47 ` kernel test robot
2022-07-21 9:48 ` Michael Walle [this message]
2022-07-21 9:48 ` Michael Walle
2022-07-21 9:52 ` Biju Das
2022-07-21 9:52 ` Biju Das
2022-10-28 18:00 ` Biju Das
2022-10-28 18:00 ` Biju Das
2022-07-28 3:28 ` Tudor.Ambarus
2022-07-28 3:28 ` Tudor.Ambarus
2022-07-29 1:40 ` Takahiro Kuwano
2022-07-29 1:40 ` Takahiro Kuwano
2022-05-13 13:35 ` [PATCH 6/6] mtd: spi-nor: sysfs: print JEDEC ID for " Michael Walle
2022-05-13 13:35 ` Michael Walle
2022-07-29 1:25 ` Takahiro Kuwano
2022-07-29 1:25 ` Takahiro Kuwano
2022-07-26 8:06 ` [PATCH 0/6] mtd: spi-nor: " Tudor.Ambarus
2022-07-26 8:06 ` Tudor.Ambarus
2022-07-29 1:52 ` Takahiro Kuwano
2022-07-29 1:52 ` Takahiro Kuwano
2022-07-29 5:34 ` Tudor.Ambarus
2022-07-29 5:34 ` Tudor.Ambarus
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e6b22ad3b427770625aa56a4fe700e5c@walle.cc \
--to=michael@walle.cc \
--cc=biju.das.jz@bp.renesas.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=miquel.raynal@bootlin.com \
--cc=p.yadav@ti.com \
--cc=richard@nod.at \
--cc=tudor.ambarus@microchip.com \
--cc=vigneshr@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.