aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pwm/pwm-microchip-core.c
diff options
context:
space:
mode:
authorNathan Chancellor <[email protected]>2025-07-15 19:56:16 +0000
committerAndrew Morton <[email protected]>2025-07-20 02:26:17 +0000
commit153ad566724fe6f57b14f66e9726d295d22e576d (patch)
tree50f14cb4806aa705aadf647228b948d6fac1ff39 /drivers/pwm/pwm-microchip-core.c
parentmm: update MAINTAINERS entry for HMM (diff)
downloadkernel-153ad566724fe6f57b14f66e9726d295d22e576d.tar.gz
kernel-153ad566724fe6f57b14f66e9726d295d22e576d.zip
mm/ksm: fix -Wsometimes-uninitialized from clang-21 in advisor_mode_show()
After a recent change in clang to expose uninitialized warnings from const variables [1], there is a false positive warning from the if statement in advisor_mode_show(). mm/ksm.c:3687:11: error: variable 'output' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized] 3687 | else if (ksm_advisor == KSM_ADVISOR_SCAN_TIME) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ mm/ksm.c:3690:33: note: uninitialized use occurs here 3690 | return sysfs_emit(buf, "%s\n", output); | ^~~~~~ Rewrite the if statement to implicitly make KSM_ADVISOR_NONE the else branch so that it is obvious to the compiler that ksm_advisor can only be KSM_ADVISOR_NONE or KSM_ADVISOR_SCAN_TIME due to the assignments in advisor_mode_store(). Link: https://lkml.kernel.org/r/20250715-ksm-fix-clang-21-uninit-warning-v1-1-f443feb4bfc4@kernel.org Fixes: 66790e9a735b ("mm/ksm: add sysfs knobs for advisor") Signed-off-by: Nathan Chancellor <[email protected]> Closes: https://github.com/ClangBuiltLinux/linux/issues/2100 Link: https://github.com/llvm/llvm-project/commit/2464313eef01c5b1edf0eccf57a32cdee01472c7 [1] Acked-by: David Hildenbrand <[email protected]> Cc: Chengming Zhou <[email protected]> Cc: Stefan Roesch <[email protected]> Cc: xu xin <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
Diffstat (limited to 'drivers/pwm/pwm-microchip-core.c')
0 files changed, 0 insertions, 0 deletions