Skip to content

Commit 5343558

Browse files
committed
x86/microcode/AMD: Fix a -Wsometimes-uninitialized clang false positive
Initialize equiv_id in order to shut up: arch/x86/kernel/cpu/microcode/amd.c:714:6: warning: variable 'equiv_id' is \ used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] if (x86_family(bsp_cpuid_1_eax) < 0x17) { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ because clang doesn't do interprocedural analysis for warnings to see that this variable won't be used uninitialized. Fixes: 94838d2 ("x86/microcode/AMD: Use the family,model,stepping encoded in the patch ID") Reported-by: kernel test robot <[email protected]> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ Signed-off-by: Borislav Petkov (AMD) <[email protected]>
1 parent 94838d2 commit 5343558

File tree

1 file changed

+1
-1
lines changed
  • arch/x86/kernel/cpu/microcode

1 file changed

+1
-1
lines changed

arch/x86/kernel/cpu/microcode/amd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,7 @@ static struct ucode_patch *find_patch(unsigned int cpu)
703703
{
704704
struct ucode_cpu_info *uci = ucode_cpu_info + cpu;
705705
u32 rev, dummy __always_unused;
706-
u16 equiv_id;
706+
u16 equiv_id = 0;
707707

708708
/* fetch rev if not populated yet: */
709709
if (!uci->cpu_sig.rev) {

0 commit comments

Comments
 (0)