mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 2/2] ARM: i.MX9: initialize max_speed in imx9_cpu_speed_grade_hz
Date: Mon, 31 Aug 2026 16:44:19 +0200	[thread overview]
Message-ID: <20260831144434.1032533-2-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20260831144434.1032533-1-a.fatoum@pengutronix.de>

When built with clang, following warning is produced:

  arch/arm/mach-imx/imx9.c:36:6: error: variable 'max_speed' is used
  uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]

The read is not reachable today, as the only caller chain is
imx_init() -> imx93_init() -> imx93_set_arm_clock() and imx_init() enters
it only under cpu_is_mx93(), but that stops being true as soon as another
i.MX9 SoC is added.

Initialize it to U32_MAX, so the fused speed grade is left as-is when
no maximum is known.

Fixes: 37912154d88a ("ARM: initial i.MX9 support")
Assisted-by: Claude:fable-5
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 arch/arm/mach-imx/imx9.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-imx/imx9.c b/arch/arm/mach-imx/imx9.c
index ada4048d4ca0..4344de260238 100644
--- a/arch/arm/mach-imx/imx9.c
+++ b/arch/arm/mach-imx/imx9.c
@@ -24,7 +24,7 @@ static u32 imx9_read_shadow_fuse(int fuse)
 
 static u32 imx9_cpu_speed_grade_hz(void)
 {
-	u32 speed, max_speed;
+	u32 speed, max_speed = U32_MAX;
 	u32 val;
 
 	val = imx9_read_shadow_fuse(19);
-- 
2.47.3




      reply	other threads:[~2026-08-31 14:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-31 14:44 [PATCH 1/2] clk: k3: pll: initialize success flag in ti_pll_wait_for_lock Ahmad Fatoum
2026-08-31 14:44 ` Ahmad Fatoum [this message]

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=20260831144434.1032533-2-a.fatoum@pengutronix.de \
    --to=a.fatoum@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