From patchwork Mon Aug 20 21:37:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 10570813 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D1AA61390 for ; Mon, 20 Aug 2018 21:39:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B61AB29BC6 for ; Mon, 20 Aug 2018 21:39:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A898229BCB; Mon, 20 Aug 2018 21:39:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 48B1B29BC6 for ; Mon, 20 Aug 2018 21:39:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726797AbeHUA4O (ORCPT ); Mon, 20 Aug 2018 20:56:14 -0400 Received: from mout.kundenserver.de ([212.227.126.134]:57116 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726649AbeHUA4O (ORCPT ); Mon, 20 Aug 2018 20:56:14 -0400 Received: from wuerfel.lan ([109.193.40.16]) by mrelayeu.kundenserver.de (mreue001 [212.227.15.129]) with ESMTPA (Nemesis) id 0Lqqpv-1gLxpo0gGB-00eZKM; Mon, 20 Aug 2018 23:38:11 +0200 From: Arnd Bergmann To: Paolo Bonzini , =?utf-8?b?UmFkaW0gS3LEjW3DocWZ?= , Thomas Gleixner , Ingo Molnar , x86@kernel.org Cc: Arnd Bergmann , "H. Peter Anvin" , Wanpeng Li , David Hildenbrand , Liran Alon , Christoffer Dall , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] x86: kvm: avoid unused variable warning Date: Mon, 20 Aug 2018 23:37:50 +0200 Message-Id: <20180820213808.2258428-1-arnd@arndb.de> X-Mailer: git-send-email 2.18.0 X-Provags-ID: V03:K1:NZJJBIUxDf6HoOh1NyOEmX5lWi6+o5MaADGA2G+FO9mqEvIOiod XrqIAXrsqKHqiZF7pg9VHiRv3nbyXXsdyxvTuZ0GLqBXY7s2bZkKcl5dIUcJ5CXlAVd1/Ct qPkBAyZZRGGet4FGVGcwdbzwOaMvUA/2HFueX7aSWil4tmypF3mJIhwY0BCaqtLjhxtvXDw uen6Hn7QeA5McFK6Qp8UA== X-UI-Out-Filterresults: notjunk:1;V01:K0:4Dlp5PXFFxs=:3eCRueqQZ5TXjw30/h+Ahd j/H5JyI6I4lUDQLgCCibcsz2T0WneoRUeH0XIYkiWJIA2R3ek8eQESt/ut7EeMxqNAe6S97Zc vMfaRAZNsEOTsZ34JXSSuT5stscjceH63QQhTbUZKXusVurTyZxLfvGbbga1EI/svq1wdYvap u/VYT9ydV3eTR6Lx7Z4ImX4XXPW1YMYwVRTDPH/WU9jYPtrPSDZMR4g/oelA5p2His8n5IMdS eSunSLvcmQFUlaeLolmnIgesN9+glEkR+o3mn7Q/HCcMVBiaj1dP49dqfs3DUU7XMmLynk7DS ZEP/wktgSsTNa4RXw/kJO9xQF8qByO4BY1VF6DRp7/8HqlCivznxB7W54FS2lQf2U5WhrDPQb 0S3xNyvnqZWXEv35+IMkTGvqfVHeYEn6roa/UGjfcs/tidcDR/zutBfAnxiArbyQasKijORfD 02NrbiJTyODkaPazzqN5k56bN+PJff6oC4yoJ073DSPLYXUSfQvhMTGOUH7wE4aYVMC+8LNrF nEK256lSK1I1GyUMbhIhsDhtP0UQ0uBlcqxfTynnaGtys1IRo9k4Ie2SOFF7rNCzGdB60zB8g TYtuite5wCBenMmYZDiw3+5By1xt2fYTEzod0HKTF3kvUbbBwBPRdblY431wG7uXNsT3t1PEA NJKFLxfeQ1+d1w/zercPvxWiCwM7EDGtCZ6Eqhx/dbC0EGc1tPbKgG3alwPSZt7RJwMc= Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: David Hildenbrand --- 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); }