From: Wei Liu <wei.liu@kernel.org>
To: Jinank Jain <jinankjain@linux.microsoft.com>
Cc: Tom Rix <trix@redhat.com>,
kys@microsoft.com, haiyangz@microsoft.com, wei.liu@kernel.org,
decui@microsoft.com, tglx@linutronix.de, mingo@redhat.com,
bp@alien8.de, dave.hansen@linux.intel.com, hpa@zytor.com,
mikelley@microsoft.com, nunodasneves@linux.microsoft.com,
x86@kernel.org, linux-hyperv@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86/hyperv: conditionally build hv_get_nested_reg()
Date: Tue, 17 Jan 2023 13:12:16 +0000 [thread overview]
Message-ID: <Y8aesLLS3sBPwLQY@liuwe-devbox-debian-v2> (raw)
In-Reply-To: <401ef436-5f78-6dd7-0157-5b580c6b7f87@linux.microsoft.com>
On Tue, Jan 17, 2023 at 03:41:18PM +0530, Jinank Jain wrote:
> Reviewed-by: Jinank Jain <jinankjain@linux.microsoft.com>
>
I will just fold this into the buggy patch since that has not been sent
to Linus.
Thanks Tom and Jinank.
> On 1/14/2023 7:26 AM, Tom Rix wrote:
> > cppcheck reports
> > [arch/x86/kernel/cpu/mshyperv.c:44]: (style) The function 'hv_get_nested_reg' is never used.
> >
> > hv_get_nested_reg() is built unconditially but is only used conditionally in
> > hv_get_register() and hv_set_register() by CONFIG_HYPERV.
> >
> > Move the conditional #if to also include hv_get_nested_reg()
> >
> > Fixes: 89acd9b2ff8e ("Drivers: hv: Setup synic registers in case of nested root partition")
> > Signed-off-by: Tom Rix <trix@redhat.com>
> > ---
> > arch/x86/kernel/cpu/mshyperv.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyperv.c
> > index b8bb13daacf7..9ca202970569 100644
> > --- a/arch/x86/kernel/cpu/mshyperv.c
> > +++ b/arch/x86/kernel/cpu/mshyperv.c
> > @@ -41,6 +41,7 @@ bool hv_root_partition;
> > bool hv_nested;
> > struct ms_hyperv_info ms_hyperv;
> > +#if IS_ENABLED(CONFIG_HYPERV)
> > static inline unsigned int hv_get_nested_reg(unsigned int reg)
> > {
> > switch (reg) {
> > @@ -61,7 +62,6 @@ static inline unsigned int hv_get_nested_reg(unsigned int reg)
> > }
> > }
> > -#if IS_ENABLED(CONFIG_HYPERV)
> > u64 hv_get_non_nested_register(unsigned int reg)
> > {
> > u64 value;
prev parent reply other threads:[~2023-01-17 13:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-14 1:56 [PATCH] x86/hyperv: conditionally build hv_get_nested_reg() Tom Rix
2023-01-17 10:11 ` Jinank Jain
2023-01-17 13:12 ` 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=Y8aesLLS3sBPwLQY@liuwe-devbox-debian-v2 \
--to=wei.liu@kernel.org \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=decui@microsoft.com \
--cc=haiyangz@microsoft.com \
--cc=hpa@zytor.com \
--cc=jinankjain@linux.microsoft.com \
--cc=kys@microsoft.com \
--cc=linux-hyperv@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mikelley@microsoft.com \
--cc=mingo@redhat.com \
--cc=nunodasneves@linux.microsoft.com \
--cc=tglx@linutronix.de \
--cc=trix@redhat.com \
--cc=x86@kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.