From patchwork Wed Oct 27 02:42:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qian Cai X-Patchwork-Id: 12586269 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 199CAC433EF for ; Wed, 27 Oct 2021 02:44:00 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D70D261002 for ; Wed, 27 Oct 2021 02:43:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org D70D261002 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=quicinc.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:CC :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=MpTjD65yV55oNF9WF00A0fj81YUtZDPpEzBosoDWtec=; b=TMdYsaxcJOQpmA zWv1A8uZ29T4LNKsH188Cnu6K7aIAfGoPJkJ86n5usZLvmiTMJ8jKgEGWC5bd6L6SnNLmXRU904XA G1ds9MRRStzCldfvwXHmo1XkscZ4PfE8lwn2wC7dQfthZtwpCgbOz1Hv2EAEHKBYpjGk7NLXT9NHB KfAkMblafac6TKhVDVi8FdKO5OkjKM8LUsht+6EjvoE8od6Zum23MxrBlT6zGT4fJnQBo6NS1dN/K 4YKKDb1k3VyDf0T/IWlLTxKq/dNEkYsEcbG93L/CCRlpLgdyDUOnxXe8unMzOLANSVrG9wjVBpFuz Bh1CImYQsvhkSzuTHuMg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mfYtp-003f74-TO; Wed, 27 Oct 2021 02:42:46 +0000 Received: from alexa-out.qualcomm.com ([129.46.98.28]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mfYtm-003f6C-DN for linux-arm-kernel@lists.infradead.org; Wed, 27 Oct 2021 02:42:43 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1635302562; x=1666838562; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=L/uG5CU2gMtP7B26JcOoa7vhnzcIoGWSJZKXSNZS4YA=; b=q3j0WOL9bCEfnvF0TTJE7+yl5F4V5LpAIUFQmiyF7rKOtX8+c+RPQyl9 pBGjoFYcwjXEc1AWxK/kdXhaKa7zXnmtrDGSh8eAGOJ4I+aLIQ9FcC691 PzdT8Jghgmn4tWc6T8mf7ANDNCiX2+WrgLuOA8b+BfeI091A4g0ea4gWX o=; Received: from ironmsg07-lv.qualcomm.com ([10.47.202.151]) by alexa-out.qualcomm.com with ESMTP; 26 Oct 2021 19:42:41 -0700 X-QCInternal: smtphost Received: from nalasex01a.na.qualcomm.com ([10.47.209.196]) by ironmsg07-lv.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Oct 2021 19:42:41 -0700 Received: from qian-HP-Z2-SFF-G5-Workstation.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.922.7; Tue, 26 Oct 2021 19:42:39 -0700 From: Qian Cai To: Marc Zyngier CC: James Morse , Alexandru Elisei , Suzuki K Poulose , Catalin Marinas , Will Deacon , , , , Qian Cai Subject: [PATCH] KVM: arm64: Avoid shadowing a previous local Date: Tue, 26 Oct 2021 22:42:12 -0400 Message-ID: <20211027024212.64842-1-quic_qiancai@quicinc.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211026_194242_544083_3E0E61FE X-CRM114-Status: GOOD ( 11.28 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org It is less-prone to have a different variable name from the one in a wider scope. This is also flagged by GCC (W=2): In file included from ./include/linux/kvm_host.h:39, from arch/arm64/kvm/arm.c:12: arch/arm64/kvm/arm.c: In function 'kvm_arch_vcpu_ioctl_run': ./arch/arm64/include/asm/kvm_host.h:638:26: warning: declaration of 'ret' shadows a previous local [-Wshadow] 638 | typeof(f(__VA_ARGS__)) ret; \ | ^~~ arch/arm64/kvm/arm.c:852:9: note: in expansion of macro 'kvm_call_hyp_ret' 852 | ret = kvm_call_hyp_ret(__kvm_vcpu_run, vcpu); | ^~~~~~~~~~~~~~~~ arch/arm64/kvm/arm.c:773:6: note: shadowed declaration is here 773 | int ret; | ^~~ Signed-off-by: Qian Cai --- arch/arm64/include/asm/kvm_host.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h index 4be8486042a7..4693d84ccd95 100644 --- a/arch/arm64/include/asm/kvm_host.h +++ b/arch/arm64/include/asm/kvm_host.h @@ -635,16 +635,16 @@ void kvm_arm_resume_guest(struct kvm *kvm); #define kvm_call_hyp_ret(f, ...) \ ({ \ - typeof(f(__VA_ARGS__)) ret; \ + typeof(f(__VA_ARGS__)) __ret; \ \ if (has_vhe()) { \ - ret = f(__VA_ARGS__); \ + __ret = f(__VA_ARGS__); \ isb(); \ } else { \ - ret = kvm_call_hyp_nvhe(f, ##__VA_ARGS__); \ + __ret = kvm_call_hyp_nvhe(f, ##__VA_ARGS__); \ } \ \ - ret; \ + __ret; \ }) #else /* __KVM_NVHE_HYPERVISOR__ */ #define kvm_call_hyp(f, ...) f(__VA_ARGS__)