From: Ahmad Fatoum <a.fatoum@pengutronix.de> To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>, barebox@lists.infradead.org Cc: "Jürgen Borleis" <jbe@pengutronix.de> Subject: Re: [PATCH] ARM: i.MX: Make sure *_get_boot_source always assignes *src Date: Fri, 10 Jun 2022 19:34:49 +0200 [thread overview] Message-ID: <0b29c92c-b895-c1a9-6586-9605386f9f45@pengutronix.de> (raw) In-Reply-To: <20220610165057.86722-1-u.kleine-koenig@pengutronix.de> On 10.06.22 18:50, Uwe Kleine-König wrote: > Callers of *_get_boot_source (e.g. start_atf() of > nxp-imx8mm-evk or protonic-imx8m) expect src to hold the bootsource > after return. So assign a value also for the "unknown" case. Did you check existing in-tree users to make sure none assigned a different fallback value and assumed it won't be overwritten if no bootsource could be found? > > Fixes: ea55770308c0 ("ARM: i.MX: Add i.MX7 base architecture support") > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> > --- > arch/arm/mach-imx/boot.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/arch/arm/mach-imx/boot.c b/arch/arm/mach-imx/boot.c > index 63afdf1ef4ed..1b0bccb7fed8 100644 > --- a/arch/arm/mach-imx/boot.c > +++ b/arch/arm/mach-imx/boot.c > @@ -285,6 +285,8 @@ void imx53_get_boot_source(enum bootsource *src, int *instance) > default: > if (imx53_bootsource_nand(cfg1)) > *src = BOOTSOURCE_NAND; > + else > + *src = BOOTSOURCE_UNKNOWN; > break; > } > > @@ -464,6 +466,8 @@ void imx6_get_boot_source(enum bootsource *src, int *instance) > default: > if (imx53_bootsource_nand(bootmode)) > *src = BOOTSOURCE_NAND; > + else > + *src = BOOTSOURCE_UNKNOWN; > break; > } > } > @@ -526,6 +530,7 @@ static void __imx7_get_boot_source(enum bootsource *src, int *instance, > *src = BOOTSOURCE_SERIAL; > break; > default: > + *src = BOOTSOURCE_UNKNOWN; > break; > } > } > @@ -629,6 +634,8 @@ void vf610_get_boot_source(enum bootsource *src, int *instance) > default: > if (imx53_bootsource_nand(sbmr1)) > *src = BOOTSOURCE_NAND; > + else > + *src = BOOTSOURCE_UNKNOWN; > break; > } > } > > base-commit: 345ef59aa0ea1a931629187449f63876501752cd -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2022-06-10 17:36 UTC|newest] Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-06-10 16:50 Uwe Kleine-König 2022-06-10 17:34 ` Ahmad Fatoum [this message] 2022-06-10 20:41 ` Uwe Kleine-König 2022-06-14 8:50 ` 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=0b29c92c-b895-c1a9-6586-9605386f9f45@pengutronix.de \ --to=a.fatoum@pengutronix.de \ --cc=barebox@lists.infradead.org \ --cc=jbe@pengutronix.de \ --cc=u.kleine-koenig@pengutronix.de \ --subject='Re: [PATCH] ARM: i.MX: Make sure *_get_boot_source always assignes *src' \ /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
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox