lkml.org 
[lkml]   [2021]   [Mar]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH -next] x86: Fix unused variable 'hi'
    On Tue, Mar 23, 2021 at 10:50:13AM +0800, Xu Yihang wrote:
    > 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 stores on bit 31:0 and HV_X64_MSR_TPR stores in bit 7:0, which means higher
    > 32 bits are not really used, therefore potentially cast to void in order to silent this warning.
    >
    > Reported-by: Hulk Robot <hulkci@huawei.com>
    > Signed-off-by: Xu Yihang <xuyihang@huawei.com>
    > ---
    > arch/x86/hyperv/hv_apic.c | 2 ++
    > 1 file changed, 2 insertions(+)
    >
    > diff --git a/arch/x86/hyperv/hv_apic.c b/arch/x86/hyperv/hv_apic.c
    > index 284e73661a18..a8b639498033 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;

    I would like to remove the space while committing this patch. There is
    no need for you to do anything.

    Wei.

    > return reg_val;
    >
    > default:
    > --
    > 2.17.1
    >

    \
     
     \ /
      Last update: 2021-03-23 12:33    [W:2.577 / U:0.040 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site