[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20210324112810.lkeu3ffv6dv7fbab@liuwe-devbox-debian-v2>
Date: Wed, 24 Mar 2021 11:28:10 +0000
From: Wei Liu <wei.liu@...nel.org>
To: Xu Yihang <xuyihang@...wei.com>
Cc: kys@...rosoft.com, haiyangz@...rosoft.com, sthemmin@...rosoft.com,
tglx@...utronix.de, mingo@...hat.com, bp@...en8.de, x86@...nel.org,
linux-hyperv@...r.kernel.org, linux-kernel@...r.kernel.org,
johnny.chenyi@...wei.com, heying24@...wei.com,
Wei Liu <wei.liu@...nel.org>
Subject: Re: [PATCH -next] x86: Fix unused variable 'msr_val' warning
On Tue, Mar 23, 2021 at 10:43:02AM +0800, Xu Yihang wrote:
> Fixes the following W=1 kernel build warning(s):
> arch/x86/hyperv/hv_spinlock.c:28:16: warning: variable ‘msr_val’ set but not used [-Wunused-but-set-variable]
> unsigned long msr_val;
>
> As Hypervisor Top-Level Functional Specification states in chapter 7.5 Virtual Processor Idle Sleep State, "A partition which possesses the AccessGuestIdleMsr privilege (refer to section 4.2.2) may trigger entry into the virtual processor idle sleep state through a read to the hypervisor-defined MSR HV_X64_MSR_GUEST_IDLE". That means only a read is necessary, msr_val is not uesed, so potentially cast to void in order to silent this warning.
>
> Reference:
> https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/reference/tlfs
>
> Reported-by: Hulk Robot <hulkci@...wei.com>
> Signed-off-by: Xu Yihang <xuyihang@...wei.com>
Applied to hyperv-next. Thanks.
Powered by blists - more mailing lists