[PATCH 1/1] x86/hyper-v: Fix 'set but not used' warnings

From: Michael Kelley
Date: Fri Dec 21 2018 - 19:07:06 EST


In these two cases, a value returned by rdmsr() or rdmsrl()
is ignored. Indicate that ignoring the value is intentional, so
that with the W=1 compilation option no warning is generated.

Signed-off-by: Michael Kelley <mikelley@xxxxxxxxxxxxx>
---
arch/x86/hyperv/hv_apic.c | 2 +-
arch/x86/hyperv/hv_spinlock.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/hyperv/hv_apic.c b/arch/x86/hyperv/hv_apic.c
index 8eb6fbee..66a0f53 100644
--- a/arch/x86/hyperv/hv_apic.c
+++ b/arch/x86/hyperv/hv_apic.c
@@ -55,7 +55,7 @@ static void hv_apic_icr_write(u32 low, u32 id)

static u32 hv_apic_read(u32 reg)
{
- u32 reg_val, hi;
+ u32 reg_val, __maybe_unused hi;

switch (reg) {
case APIC_EOI:
diff --git a/arch/x86/hyperv/hv_spinlock.c b/arch/x86/hyperv/hv_spinlock.c
index a861b04..e18c63d5 100644
--- a/arch/x86/hyperv/hv_spinlock.c
+++ b/arch/x86/hyperv/hv_spinlock.c
@@ -25,7 +25,7 @@ static void hv_qlock_kick(int cpu)

static void hv_qlock_wait(u8 *byte, u8 val)
{
- unsigned long msr_val;
+ unsigned long __maybe_unused msr_val;
unsigned long flags;

if (in_nmi())
--
1.8.3.1