Commit f6b1eebb authored by Nathan Chancellor's avatar Nathan Chancellor Committed by Mario Limonciello
Browse files

cpufreq/amd-pstate: Avoid shadowing ret in amd_pstate_ut_check_driver()



Clang warns (or errors with CONFIG_WERROR=y):

  drivers/cpufreq/amd-pstate-ut.c:262:6: error: variable 'ret' is uninitialized when used here [-Werror,-Wuninitialized]
    262 |         if (ret)
        |             ^~~

ret is declared at the top of the function and in the for loop so the
initialization of ret is local to the loop. Remove the declaration in
the for loop so that ret is always used initialized.

Fixes: d26d1643 ("amd-pstate-ut: Reset amd-pstate driver mode after running selftests")
Reported-by: default avatarkernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202505072226.g2QclhaR-lkp@intel.com/


Signed-off-by: default avatarNathan Chancellor <nathan@kernel.org>
Acked-by: default avatarMario Limonciello <mario.limonciello@amd.com>
Link: https://lore.kernel.org/r/20250512-amd-pstate-ut-uninit-ret-v1-1-fcb4104f502e@kernel.org


Signed-off-by: default avatarMario Limonciello <mario.limonciello@amd.com>
parent d26d1643
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment