linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu@kernel.org>
To: Xu Yihang <xuyihang@huawei.com>
Cc: kys@microsoft.com, haiyangz@microsoft.com,
	sthemmin@microsoft.com, wei.liu@kernel.org, tglx@linutronix.de,
	mingo@redhat.com, bp@alien8.de, x86@kernel.org, hpa@zytor.com,
	linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org,
	johnny.chenyi@huawei.com
Subject: Re: [PATCH -next] x86: Fix unused variable 'hi'
Date: Wed, 24 Mar 2021 11:34:26 +0000	[thread overview]
Message-ID: <20210324113426.n5xmcqmrsjzrgwrd@liuwe-devbox-debian-v2> (raw)
In-Reply-To: <20210323113250.ktsfwr2wzjycugyk@liuwe-devbox-debian-v2>

On Tue, Mar 23, 2021 at 11:32:50AM +0000, Wei Liu wrote:
> 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.

Applied to hyperv-next.

      reply	other threads:[~2021-03-24 11:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-18  7:46 [PATCH -next] x86: Fix unused variable 'hi' Xu Yihang
2021-03-18 11:24 ` Ingo Molnar
2021-03-19 18:58   ` Michael Kelley
     [not found] ` <20210322035426.71169-1-xuyihang@huawei.com>
2021-03-22  3:54   ` Xu Yihang
2021-03-22 11:02     ` Wei Liu
2021-03-23  2:50 ` Xu Yihang
2021-03-23 11:32   ` Wei Liu
2021-03-24 11:34     ` Wei Liu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210324113426.n5xmcqmrsjzrgwrd@liuwe-devbox-debian-v2 \
    --to=wei.liu@kernel.org \
    --cc=bp@alien8.de \
    --cc=haiyangz@microsoft.com \
    --cc=hpa@zytor.com \
    --cc=johnny.chenyi@huawei.com \
    --cc=kys@microsoft.com \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=sthemmin@microsoft.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    --cc=xuyihang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).