From: Johannes Zink <j.zink@pengutronix.de>
To: barebox@lists.infradead.org
Subject: Re: [PATCH] fixup! bootsource: allow DT aliases and bootrom numbering to differ
Date: Wed, 20 Jul 2022 11:29:39 +0200 [thread overview]
Message-ID: <d7a4d566f85e550ea71c879154160fa433824e2c.camel@pengutronix.de> (raw)
In-Reply-To: <20220720083215.1245844-1-j.zink@pengutronix.de>
On Wed, 2022-07-20 at 10:32 +0200, Johannes Zink wrote:
> bootsource was used when src should have been instead. While at it,
> rename bs to src for alignment with other functions.
>
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> Signed-off-by: Johannes Zink <j.zink@pengutronix.de>
> ---
> common/bootsource.c | 18 +++++++++---------
> 1 file changed, 9 insertions(+), 9 deletions(-)
>
> diff --git a/common/bootsource.c b/common/bootsource.c
> index d74c5e5cb..70bac945d 100644
> --- a/common/bootsource.c
> +++ b/common/bootsource.c
> @@ -33,9 +33,9 @@ static enum bootsource bootsource =
> BOOTSOURCE_UNKNOWN;
> static int bootsource_instance = BOOTSOURCE_INSTANCE_UNKNOWN;
> const char *bootsource_alias_name = NULL;
>
> -const char *bootsource_get_alias_stem(enum bootsource bs)
> +const char *bootsource_get_alias_stem(enum bootsource src)
> {
> - switch (bs) {
> + switch (src) {
> /*
> * For I2C and SPI EEPROMs we set the stem to be
> 'i2c'
> * and 'spi' correspondingly. The resulting alias
> will
> @@ -55,7 +55,7 @@ const char *bootsource_get_alias_stem(enum
> bootsource bs)
> case BOOTSOURCE_MMC: /* FALLTHROUGH */
> case BOOTSOURCE_SPI: /* FALLTHROUGH */
> case BOOTSOURCE_CAN:
> - return bootsource_str[bootsource];
> + return bootsource_str[src];
> default:
> return NULL;
> }
> @@ -127,7 +127,7 @@ void bootsource_set_raw_instance(int instance)
> pr_setenv("bootsource_instance", "%d", instance);
> }
>
> -int bootsource_of_alias_xlate(enum bootsource bs, int instance)
> +int bootsource_of_alias_xlate(enum bootsource src, int instance)
> {
> char alias[sizeof("barebox,bootsource-harddisk4294967295")];
> const char *bootsource_stem;
> @@ -137,11 +137,11 @@ int bootsource_of_alias_xlate(enum bootsource
> bs, int instance)
> if (!IS_ENABLED(CONFIG_OFDEVICE))
> return BOOTSOURCE_INSTANCE_UNKNOWN;
>
> - if (bs == BOOTSOURCE_UNKNOWN ||
> + if (src == BOOTSOURCE_UNKNOWN ||
> instance == BOOTSOURCE_INSTANCE_UNKNOWN)
> return BOOTSOURCE_INSTANCE_UNKNOWN;
>
> - bootsource_stem = bootsource_get_alias_stem(bs);
> + bootsource_stem = bootsource_get_alias_stem(src);
> if (!bootsource_stem)
> return BOOTSOURCE_INSTANCE_UNKNOWN;
>
> @@ -159,15 +159,15 @@ int bootsource_of_alias_xlate(enum bootsource
> bs, int instance)
> return alias_id;
> }
>
> -int bootsource_set(enum bootsource bs, int instance)
> +int bootsource_set(enum bootsource src, int instance)
> {
> int alias_id;
>
> - alias_id = bootsource_of_alias_xlate(bs, instance);
> + alias_id = bootsource_of_alias_xlate(src, instance);
> if (alias_id == BOOTSOURCE_INSTANCE_UNKNOWN)
> alias_id = instance;
>
> - bootsource_set_raw(bs, alias_id);
> + bootsource_set_raw(src, alias_id);
>
> return alias_id;
> }
Tested-by: Johannes Zink <j.zink@pengutronix.de> # Radxa Rockpi3A
(RK3568)
--
Pengutronix e.K. | Johannes Zink |
Steuerwalder Str. 21 | https://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686| Fax: +49-5121-206917-5555 |
next prev parent reply other threads:[~2022-07-20 9:31 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-20 5:50 [RFT PATCH 0/3] ARM: Rockchip: align bootsource_instance Ahmad Fatoum
2022-07-20 5:50 ` [RFT PATCH 1/3] bootsource: rename existing bootsource_set to bootsource_set_raw Ahmad Fatoum
2022-07-20 5:50 ` [RFT PATCH 2/3] bootsource: allow DT aliases and bootrom numbering to differ Ahmad Fatoum
2022-07-20 8:32 ` [PATCH] fixup! " Johannes Zink
2022-07-20 9:29 ` Johannes Zink [this message]
2022-07-20 5:50 ` [RFT PATCH 3/3] ARM: dts: rk356x: align bootsource_instance numbering and MMC DT aliases Ahmad Fatoum
2022-07-20 9:30 ` Johannes Zink
2022-07-20 10:45 ` Ahmad Fatoum
2022-08-09 7:41 ` [RFT PATCH 0/3] ARM: Rockchip: align bootsource_instance Sascha Hauer
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=d7a4d566f85e550ea71c879154160fa433824e2c.camel@pengutronix.de \
--to=j.zink@pengutronix.de \
--cc=barebox@lists.infradead.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox