All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tom Rix <trix@redhat.com>
To: 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, jinankjain@linux.microsoft.com,
	nunodasneves@linux.microsoft.com
Cc: x86@kernel.org, linux-hyperv@vger.kernel.org,
	linux-kernel@vger.kernel.org, Tom Rix <trix@redhat.com>
Subject: [PATCH] x86/hyperv: conditionally build hv_get_nested_reg()
Date: Fri, 13 Jan 2023 20:56:43 -0500	[thread overview]
Message-ID: <20230114015643.3950640-1-trix@redhat.com> (raw)

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;
-- 
2.27.0


             reply	other threads:[~2023-01-14  1:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-14  1:56 Tom Rix [this message]
2023-01-17 10:11 ` [PATCH] x86/hyperv: conditionally build hv_get_nested_reg() Jinank Jain
2023-01-17 13:12   ` Wei Liu

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=20230114015643.3950640-1-trix@redhat.com \
    --to=trix@redhat.com \
    --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=wei.liu@kernel.org \
    --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.