All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Rob Herring (Arm)" <robh@kernel.org>
To: "Rafael J. Wysocki" <rafael@kernel.org>,
	Viresh Kumar <viresh.kumar@linaro.org>,
	Nathan Chancellor <nathan@kernel.org>,
	Nick Desaulniers <ndesaulniers@google.com>,
	Bill Wendling <morbo@google.com>,
	Justin Stitt <justinstitt@google.com>
Cc: kernel test robot <lkp@intel.com>,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	llvm@lists.linux.dev
Subject: [PATCH] cpufreq: spear: Fix uninitialized variable "i"
Date: Mon,  5 Aug 2024 14:20:41 -0600	[thread overview]
Message-ID: <20240805202042.3229190-1-robh@kernel.org> (raw)

The refactoring in commit dca2ef2b7d91 ("cpufreq: spear: Use
of_property_for_each_u32() instead of open coding") left "i"
uninitialized. Initialize it to 0.

Note that gcc doesn't detect this, only clang does.

Fixes: dca2ef2b7d91 ("cpufreq: spear: Use of_property_for_each_u32() instead of open coding")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202408030418.gnJDcCpm-lkp@intel.com/
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
---
 drivers/cpufreq/spear-cpufreq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/cpufreq/spear-cpufreq.c b/drivers/cpufreq/spear-cpufreq.c
index 4d28147c23f1..f8c16699a68d 100644
--- a/drivers/cpufreq/spear-cpufreq.c
+++ b/drivers/cpufreq/spear-cpufreq.c
@@ -173,7 +173,7 @@ static int spear_cpufreq_probe(struct platform_device *pdev)
 	struct device_node *np;
 	struct cpufreq_frequency_table *freq_tbl;
 	u32 val;
-	int cnt, i, ret;
+	int cnt, i = 0, ret;
 
 	np = of_cpu_device_node_get(0);
 	if (!np) {
-- 
2.43.0


             reply	other threads:[~2024-08-05 20:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-05 20:20 Rob Herring (Arm) [this message]
2024-08-06  4:49 ` [PATCH] cpufreq: spear: Fix uninitialized variable "i" Viresh Kumar
2024-08-06 16:08   ` Rob Herring
2024-08-07  6:26     ` Viresh Kumar

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=20240805202042.3229190-1-robh@kernel.org \
    --to=robh@kernel.org \
    --cc=justinstitt@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=llvm@lists.linux.dev \
    --cc=morbo@google.com \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=rafael@kernel.org \
    --cc=viresh.kumar@linaro.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 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.