Skip to contentSkip to conversation

x86/microcode/amd: Fix two -Wunused-but-set-variable warnings

PATCH Applied Borislav Petkov 2 participants 2 messages Sep 28, 2019 – Oct 1, 2019

Subsystems (2)
lore
Share & tools
lore

Borislav Petkov

author maintainer
#0 lore raw

PATCH 1/1 x86/microcode/amd: Fix two -Wunused-but-set-variable warnings

From: Borislav Petkov <[email protected]>

The dummy variable is the high part of the microcode revision MSR which is defined as reserved. Mark it unused so that W=1 builds don't trigger the above warning.

No functional changes.

---
 arch/x86/kernel/cpu/microcode/amd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/kernel/cpu/microcode/amd.c +2 -2
index a0e52bd00ecc..3f6b137ef4e6 100644
@@ -567,7 +567,7 @@ int __init save_microcode_in_initrd_amd(unsigned int cpuid_1_eax)
 void reload_ucode_amd(void)
 {
 	struct microcode_amd *mc;
-	u32 rev, dummy;
+	u32 rev, dummy __always_unused;
 
 	mc = (struct microcode_amd *)amd_ucode_patch;
 
@@ -673,7 +673,7 @@ static enum ucode_state apply_microcode_amd(int cpu)
 	struct ucode_cpu_info *uci;
 	struct ucode_patch *p;
 	enum ucode_state ret;
-	u32 rev, dummy;
+	u32 rev, dummy __always_unused;
 
 	BUG_ON(raw_smp_processor_id() != cpu);
 
Signature · 1 line
2.21.0
#1 lore raw
The following commit has been merged into the x86/microcode branch of tip:

The following commit has been merged into the x86/microcode branch of tip:

Commit-ID:     2b730952066cd022d1f46e801f06ca6ca9878823
Gitweb:        https://git.kernel.org/tip/2b730952066cd022d1f46e801f06ca6ca9878823
Author:        Borislav Petkov <[email protected]>
AuthorDate:    Sat, 28 Sep 2019 16:53:56 +02:00
Committer:     Borislav Petkov <[email protected]>
CommitterDate: Tue, 01 Oct 2019 11:36:09 +02:00

x86/microcode/amd: Fix two -Wunused-but-set-variable warnings

The dummy variable is the high part of the microcode revision MSR which is defined as reserved. Mark it unused so that W=1 builds don't trigger the above warning.

No functional changes.

---
 arch/x86/kernel/cpu/microcode/amd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/kernel/cpu/microcode/amd.c +2 -2
index a0e52bd..3f6b137 100644
@@ -567,7 +567,7 @@ int __init save_microcode_in_initrd_amd(unsigned int cpuid_1_eax)
 void reload_ucode_amd(void)
 {
 	struct microcode_amd *mc;
-	u32 rev, dummy;
+	u32 rev, dummy __always_unused;
 
 	mc = (struct microcode_amd *)amd_ucode_patch;
 
@@ -673,7 +673,7 @@ static enum ucode_state apply_microcode_amd(int cpu)
 	struct ucode_cpu_info *uci;
 	struct ucode_patch *p;
 	enum ucode_state ret;
-	u32 rev, dummy;
+	u32 rev, dummy __always_unused;
 
 	BUG_ON(raw_smp_processor_id() != cpu);