From patchwork Mon Sep 25 15:10:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 13397967 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 576B9CE7A81 for ; Mon, 25 Sep 2023 15:11:02 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qknER-0008H7-HH; Mon, 25 Sep 2023 11:10:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qknEM-0008Dm-0C for qemu-devel@nongnu.org; Mon, 25 Sep 2023 11:10:38 -0400 Received: from mout.kundenserver.de ([212.227.126.135]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qknEJ-0005L8-T4 for qemu-devel@nongnu.org; Mon, 25 Sep 2023 11:10:37 -0400 Received: from quad ([82.142.8.70]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MsI8Y-1reHCH2iHC-00tlIJ; Mon, 25 Sep 2023 17:10:31 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Cc: Laurent Vivier , Markus Armbruster Subject: [PATCH 2/5] linux-user/mmap.c: clean up local variable shadowing Date: Mon, 25 Sep 2023 17:10:26 +0200 Message-ID: <20230925151029.461358-3-laurent@vivier.eu> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230925151029.461358-1-laurent@viv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A28/UhZuRpoq+ m1K/yDIjAkCd1VJGS2w5U3VK0mMWoTK6UxA3rQ25Chxl00q9NEWk1bVqtjR+uIX1ugONruL4D bjEAXA85gBXnFIB1EUEhgk4URTm9MokFLBA+uvMvNsjTSKL3Ot8flZaMl9agvGmAdMAaLaMYU +zCL06PLCsZIw2w== Received-SPF: none client-ip=212.227.126.135; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Fix following warnings: .../linux-user/mmap.c: In function 'target_mremap': .../linux-user/mmap.c:913:13: warning: declaration of 'prot' shadows a previous local [-Wshadow=compatible-local] 913 | int prot = 0; | ^~~~ ../../../Projects/qemu/linux-user/mmap.c:871:9: note: shadowed declaration is here 871 | int prot; | ^~~~ Signed-off-by: Laurent Vivier Reviewed-by: Thomas Huth --- linux-user/mmap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/linux-user/mmap.c b/linux-user/mmap.c index 8eaf57b208b0..8ccaab78590f 100644 --- a/linux-user/mmap.c +++ b/linux-user/mmap.c @@ -910,16 +910,16 @@ abi_long target_mremap(abi_ulong old_addr, abi_ulong old_size, } } } else { - int prot = 0; + int page_flags = 0; if (reserved_va && old_size < new_size) { abi_ulong addr; for (addr = old_addr + old_size; addr < old_addr + new_size; addr++) { - prot |= page_get_flags(addr); + page_flags |= page_get_flags(addr); } } - if (prot == 0) { + if (page_flags == 0) { host_addr = mremap(g2h_untagged(old_addr), old_size, new_size, flags);