From: David Hildenbrand <david@redhat.com>
To: "Arnd Bergmann" <arnd@arndb.de>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Radim Krčmář" <rkrcmar@redhat.com>,
"Thomas Gleixner" <tglx@linutronix.de>,
"Ingo Molnar" <mingo@redhat.com>,
x86@kernel.org
Cc: "H. Peter Anvin" <hpa@zytor.com>,
Wanpeng Li <wanpengli@tencent.com>,
Liran Alon <liran.alon@oracle.com>,
Christoffer Dall <christoffer.dall@linaro.org>,
kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86: kvm: avoid unused variable warning
Date: Wed, 22 Aug 2018 13:51:47 +0200 [thread overview]
Message-ID: <48a6dd11-3bba-3461-4135-045846e3c65f@redhat.com> (raw)
In-Reply-To: <20180820213808.2258428-1-arnd@arndb.de>
On 20.08.2018 23:37, Arnd Bergmann wrote:
> Removing one of the two accesses of the maxphyaddr variable led to
> a harmless warning:
>
> arch/x86/kvm/x86.c: In function 'kvm_set_mmio_spte_mask':
> arch/x86/kvm/x86.c:6563:6: error: unused variable 'maxphyaddr' [-Werror=unused-variable]
>
> Removing the #ifdef seems to be the nicest workaround, as it
> makes the code look cleaner than adding another #ifdef.
>
> Fixes: 28a1f3ac1d0c ("kvm: x86: Set highest physical address bits in non-present/reserved SPTEs")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> arch/x86/kvm/x86.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> index 4a74a7cf0a8b..506bd2b4b8bb 100644
> --- a/arch/x86/kvm/x86.c
> +++ b/arch/x86/kvm/x86.c
> @@ -6576,14 +6576,12 @@ static void kvm_set_mmio_spte_mask(void)
> /* Set the present bit. */
> mask |= 1ull;
>
> -#ifdef CONFIG_X86_64
> /*
> * If reserved bit is not supported, clear the present bit to disable
> * mmio page fault.
> */
> - if (maxphyaddr == 52)
> + if (IS_ENABLED(CONFIG_X86_64) && maxphyaddr == 52)
> mask &= ~1ull;
> -#endif
>
> kvm_mmu_set_mmio_spte_mask(mask, mask);
> }
>
Reviewed-by: David Hildenbrand <david@redhat.com>
--
Thanks,
David / dhildenb
prev parent reply other threads:[~2018-08-22 11:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-20 21:37 Arnd Bergmann
2018-08-21 10:45 ` Paolo Bonzini
2018-08-22 11:51 ` David Hildenbrand [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=48a6dd11-3bba-3461-4135-045846e3c65f@redhat.com \
--to=david@redhat.com \
--cc=arnd@arndb.de \
--cc=christoffer.dall@linaro.org \
--cc=hpa@zytor.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=liran.alon@oracle.com \
--cc=mingo@redhat.com \
--cc=pbonzini@redhat.com \
--cc=rkrcmar@redhat.com \
--cc=tglx@linutronix.de \
--cc=wanpengli@tencent.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®