diff options
author | Xu Yihang <xuyihang@huawei.com> | 2021-03-23 05:50:13 +0300 |
---|---|---|
committer | Wei Liu <wei.liu@kernel.org> | 2021-03-24 14:32:56 +0300 |
commit | 1b60280834683dddf4975bbf9662a74f123ba770 (patch) | |
tree | 5da8aa2f7115d3917cb1aad3f0d660fceee06f46 /arch/x86/hyperv/hv_apic.c | |
parent | 13c4d4626a4b205e496eb65d6316a3dcb89a7d62 (diff) | |
download | linux-1b60280834683dddf4975bbf9662a74f123ba770.tar.xz |
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>
Diffstat (limited to 'arch/x86/hyperv/hv_apic.c')
-rw-r--r-- | arch/x86/hyperv/hv_apic.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/x86/hyperv/hv_apic.c b/arch/x86/hyperv/hv_apic.c index 284e73661a18..082a04279f91 100644 --- a/arch/x86/hyperv/hv_apic.c +++ b/arch/x86/hyperv/hv_apic.c @@ -60,9 +60,11 @@ static u32 hv_apic_read(u32 reg) switch (reg) { case APIC_EOI: rdmsr(HV_X64_MSR_EOI, reg_val, hi); + (void)hi; return reg_val; case APIC_TASKPRI: rdmsr(HV_X64_MSR_TPR, reg_val, hi); + (void)hi; return reg_val; default: |