Skip to content

Commit 1b60280

Browse files
Xu Yihangliuw
authored andcommitted
x86/hyperv: Fix unused variable 'hi' warning in hv_apic_read
Fixes the following W=1 kernel build warning(s): arch/x86/hyperv/hv_apic.c:58:15: warning: variable ‘hi’ set but not used [-Wunused-but-set-variable] Compiled with CONFIG_HYPERV enabled: make allmodconfig ARCH=x86_64 CROSS_COMPILE=x86_64-linux-gnu- make W=1 arch/x86/hyperv/hv_apic.o ARCH=x86_64 CROSS_COMPILE=x86_64-linux-gnu- HV_X64_MSR_EOI occupies bit 31:0 and HV_X64_MSR_TPR occupies bit 7:0, which means the higher 32 bits are not really used. Cast the variable hi to void to silence this warning. Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Xu Yihang <xuyihang@huawei.com> Link: https://lore.kernel.org/r/20210323025013.191533-1-xuyihang@huawei.com Signed-off-by: Wei Liu <wei.liu@kernel.org>
1 parent 13c4d46 commit 1b60280

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎arch/x86/hyperv/hv_apic.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,11 @@ static u32 hv_apic_read(u32 reg)
6060
switch (reg) {
6161
case APIC_EOI:
6262
rdmsr(HV_X64_MSR_EOI, reg_val, hi);
63+
(void)hi;
6364
return reg_val;
6465
case APIC_TASKPRI:
6566
rdmsr(HV_X64_MSR_TPR, reg_val, hi);
67+
(void)hi;
6668
return reg_val;
6769

6870
default:

0 commit comments

Comments
 (0)