From nobody Fri May 17 23:37:31 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1695396623; cv=none; d=zohomail.com; s=zohoarc; b=Mg0j4Qd1SPBLAUtIGmsro+GSpWAevdV2l4yTuL3SZf78p+0LC9cHI4OByLXK3RL8Kg6dUSdGDflZ7/KQOVXMQwiBavSGaWcLMd/qdr6CMrGR3r0Nbbgkn9eZQUPTG5FCZPv8Mgcip6wSbSN/TychHdVelqbJt+qMFiaJZqpPmLk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695396623; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=O4Ow+VsK9jJEZHPQsnuiyJ0dMqoukmN8lv7f9IShQS8=; b=SlpypIVcp+tIG/y0o/fqBytbeCBKhTSD+rc077H5uaXsyCV/Ck9A858FBOMDDNN1Owzs4YAcAeGw/xWCxVRbzlBCpohNoo5u33d+OuB3E6946pDoFv4KxfPuRaahrI8wMDih9j4jRGU6FYyzjl6LlzZskv6AvRKmS48XARDgOEU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1695396623553598.1568127724627; Fri, 22 Sep 2023 08:30:23 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qji6R-0005Ln-6d; Fri, 22 Sep 2023 11:30:00 -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 1qji6K-0005Ha-Ai for qemu-devel@nongnu.org; Fri, 22 Sep 2023 11:29:52 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qji6I-00007J-B3 for qemu-devel@nongnu.org; Fri, 22 Sep 2023 11:29:52 -0400 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-401187f8071so18009525e9.0 for ; Fri, 22 Sep 2023 08:29:49 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id c22-20020a05600c171600b00405442edc69sm777137wmn.14.2023.09.22.08.29.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Sep 2023 08:29:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1695396588; x=1696001388; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=O4Ow+VsK9jJEZHPQsnuiyJ0dMqoukmN8lv7f9IShQS8=; b=OvwVqymKoRFGIYQj3RADNy+xsmWGjO2CxbPpdrd7Lvc7GSW1g7b7+GxEI5oeSJOhD2 MhfSefCkfNOX4F8V6Xhmh99E7vVl8Ujt3TxbWD/HgzWMjLgIt9uJWBn3vaK//ArlxveQ 4+EZxBju9eQhQKhGp6QBlnqKjPMoWvapQAnT5N8eBNTR2mVUFKyG7psHHpaCCBKSONKR eIDIXrjHt/LZ/9AhdkeEk3YzepwiW1B2F06BOZEnKo2XcTL2nJCpdfS4DyBpJBVGT2NL 8QYxLdeOmLIa0xk43CH517gwPp+tZEQ/wMYpodFsBUXhxmPo8Di12fMkoGFcT+tM+BxV 0dkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695396588; x=1696001388; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=O4Ow+VsK9jJEZHPQsnuiyJ0dMqoukmN8lv7f9IShQS8=; b=h9WkdNnDUVmhACFkgDn0t2qqnWQLcmgDCjoLpPkseySljyrGDBZnPrNAeDQG25sRXn uFVmrhL3cGe/AXJiMbuUXHQkEYz2t9zjm81gDPWkVEYt5H58UK1IapYryCd63Y3bmwid ix7y3to/ZswMXzNgF+Q4Dx1+INCEFiKK7V0ix1n4eEx0crkdTw6FxUta22Fi42jT3W4f YZGte0qJb7TfPm3oepFJY1Cskk+0c2OUqkrc+eIY7r9bDQepMAqbQhbMSpio4pDTp2iX 6+QNqd3HpnOokujLg3XJbADRIk1rEHz/tNmQo4Jo8V9mfLOcFzibZc0oAF1jjyCnWY/S Lpkw== X-Gm-Message-State: AOJu0YzsvCnITSyIeX6yzg3eWsda64JXYmVFxRoq6d06pXiGfupfc2dL KeXuRNqTIWQdXTtDWFCC5x6Fdw== X-Google-Smtp-Source: AGHT+IE3fNOvkyWfgjJUSfeCBeOkuzcjxqj+JjyIeTKQ/CeZZhu3Mh+fMIrldjUGn1d+8BPrj0BHuA== X-Received: by 2002:a1c:6a1a:0:b0:403:c70b:b688 with SMTP id f26-20020a1c6a1a000000b00403c70bb688mr33263wmc.6.1695396588688; Fri, 22 Sep 2023 08:29:48 -0700 (PDT) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Eric Auger , Markus Armbruster Subject: [PATCH 1/4] hw/intc/arm_gicv3_its: Avoid shadowing variable in do_process_its_cmd() Date: Fri, 22 Sep 2023 16:29:41 +0100 Message-Id: <20230922152944.3583438-2-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230922152944.3583438-1-peter.maydell@linaro.org> References: <20230922152944.3583438-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1695396625485100007 Avoid shadowing a local variable in do_process_its_cmd(): ../../hw/intc/arm_gicv3_its.c:548:17: warning: declaration of =E2=80=98ite= =E2=80=99 shadows a previous local [-Wshadow=3Dcompatible-local] 548 | ITEntry ite =3D {}; | ^~~ ../../hw/intc/arm_gicv3_its.c:518:13: note: shadowed declaration is here 518 | ITEntry ite; | ^~~ Signed-off-by: Peter Maydell Reviewed-by: Eric Auger Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/intc/arm_gicv3_its.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/intc/arm_gicv3_its.c b/hw/intc/arm_gicv3_its.c index 5f552b4d37f..52e9aca9c65 100644 --- a/hw/intc/arm_gicv3_its.c +++ b/hw/intc/arm_gicv3_its.c @@ -545,10 +545,10 @@ static ItsCmdResult do_process_its_cmd(GICv3ITSState = *s, uint32_t devid, } =20 if (cmdres =3D=3D CMD_CONTINUE_OK && cmd =3D=3D DISCARD) { - ITEntry ite =3D {}; + ITEntry i =3D {}; /* remove mapping from interrupt translation table */ - ite.valid =3D false; - return update_ite(s, eventid, &dte, &ite) ? CMD_CONTINUE_OK : CMD_= STALL; + i.valid =3D false; + return update_ite(s, eventid, &dte, &i) ? CMD_CONTINUE_OK : CMD_ST= ALL; } return CMD_CONTINUE_OK; } --=20 2.34.1 From nobody Fri May 17 23:37:31 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1695396623; cv=none; d=zohomail.com; s=zohoarc; b=auYMceAxgncPGqJWK2ufwcaKfmdL0A1SREcwtTMPlqhU6ud71Sv4s92hLP++XsRaKyaeNTQi5AGXLFZh5ZqDhQP8kO2q3WX2o7+Io8EHj2XnRKnDQ1Py4K5R99Cegx79m6nXBkyKEqsvDVeQB5Ke+XDa8f8isQfl547XB5lqtog= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695396623; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=NVF3Nkth4giVKdzfl1RSEmEQYi2EYDdx4MRHrnjWkQ0=; b=KU3ow/CsdRavA+CuAo3zB8twG3Gw5eP8euzdZ9l7hE7SdunvP7YoREMpmX9Tzo2caUL0XOpwabRi0lc07Obps3K/UouIi1BgBlMD0kow3LNc+r5rMDbMi15I5ZMJ/mxzQLbXlp8klzgRPIpnxN/5Ua1QaSJzebCxqTSkIUiQgnA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 169539662327662.00677620210615; Fri, 22 Sep 2023 08:30:23 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qji6a-0005PO-MC; Fri, 22 Sep 2023 11:30:09 -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 1qji6P-0005KU-FA for qemu-devel@nongnu.org; Fri, 22 Sep 2023 11:29:58 -0400 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qji6I-00007V-Fb for qemu-devel@nongnu.org; Fri, 22 Sep 2023 11:29:55 -0400 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-4051fea48a8so26024285e9.2 for ; Fri, 22 Sep 2023 08:29:50 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id c22-20020a05600c171600b00405442edc69sm777137wmn.14.2023.09.22.08.29.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Sep 2023 08:29:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1695396589; x=1696001389; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=NVF3Nkth4giVKdzfl1RSEmEQYi2EYDdx4MRHrnjWkQ0=; b=k0/YzH35ghikYlIiEdjrT7N2qCzplHzm7VQX4yYnxYrUbofTpH2HsuqDumFKcnxEh7 6aLhiECsfpTspaU/qJa1cKz+F8jLSZBgpcW0dfmjaJOTF+xiN7aGHs6iiwqHggjuJrAq Tu/l9C6KPj1pn9C4vmO0OYubPbPn4U7KZi/OTW3Z2iPHvyMFK0HVgcCXuHAi8suAYer1 NJVVXsShH9xBhwtgg88WnMZRx7UNmciTPprY8aE4frRA1UUAD2frmbV2eTWZLQyw7R1T aY4sqLnUtNe9iZBKADck9+CczcBk5jkyTHAYLll2mDUKBMsrMXnclTSXO9bNlyTNTQsX se2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695396589; x=1696001389; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NVF3Nkth4giVKdzfl1RSEmEQYi2EYDdx4MRHrnjWkQ0=; b=dJNMhTNcsTk9vwtXnfJTnajy03/RB+58zG7YohlPgBQ0PFdMM+0w0qudtooaYrh9L7 AD0XdrSiwk9/1nAnDOhrInWJojN12REdBU6g0/rtG3t7xtzv+GI1MLYEcuR1lNHgXZHm WgE4Lf95QxO9oZhJOMbsx0+NK634pHCAch/Gc6+Ego3FzYa2A2hwohzkYvNmepv0uggd UAnKH/wvOOKCFamO6+9k0/zk/w6TuqzgF8SkxnlqVBo54QrqIya/o0wrtf4Knn5TWmVH FVwMUC4AP4SXAHFBbE8RVm3wWw96kSQgvqktnfTNB+4Pszu1oPQPbalt+8WSgZNf2HF3 fk6A== X-Gm-Message-State: AOJu0Yy1DTukDRFmw5XkbSHxdlYyF+ntnqSDe41akhemT1P+pdMVd8XQ zFRYmAfaHH9toiUrptR6HznYDpbYD/yHOF4JZmI= X-Google-Smtp-Source: AGHT+IHM3fq7WEIkIK/XpYcSJ7tSHI+gtIawuMkUBXqlQGA2Xu/MfbB08jc100PRmJmCG3uEyBE8zg== X-Received: by 2002:a05:600c:2206:b0:403:ca21:6348 with SMTP id z6-20020a05600c220600b00403ca216348mr8025091wml.18.1695396589133; Fri, 22 Sep 2023 08:29:49 -0700 (PDT) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Eric Auger , Markus Armbruster Subject: [PATCH 2/4] hw/misc/arm_sysctl.c: Avoid shadowing local variable Date: Fri, 22 Sep 2023 16:29:42 +0100 Message-Id: <20230922152944.3583438-3-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230922152944.3583438-1-peter.maydell@linaro.org> References: <20230922152944.3583438-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x334.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1695396624124100005 Avoid shadowing a local variable in arm_sysctl_write(): ../../hw/misc/arm_sysctl.c: In function =E2=80=98arm_sysctl_write=E2=80=99: ../../hw/misc/arm_sysctl.c:537:26: warning: declaration of =E2=80=98val=E2= =80=99 shadows a parameter [-Wshadow=3Dlocal] 537 | uint32_t val; | ^~~ ../../hw/misc/arm_sysctl.c:388:39: note: shadowed declaration is here 388 | uint64_t val, unsigned size) | ~~~~~~~~~^~~ Signed-off-by: Peter Maydell Reviewed-by: Eric Auger Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/misc/arm_sysctl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/misc/arm_sysctl.c b/hw/misc/arm_sysctl.c index 42d46938543..3e4f4b05244 100644 --- a/hw/misc/arm_sysctl.c +++ b/hw/misc/arm_sysctl.c @@ -534,12 +534,12 @@ static void arm_sysctl_write(void *opaque, hwaddr off= set, s->sys_cfgstat |=3D 2; /* error */ } } else { - uint32_t val; + uint32_t data; if (!vexpress_cfgctrl_read(s, dcc, function, site, positio= n, - device, &val)) { + device, &data)) { s->sys_cfgstat |=3D 2; /* error */ } else { - s->sys_cfgdata =3D val; + s->sys_cfgdata =3D data; } } } --=20 2.34.1 From nobody Fri May 17 23:37:31 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1695396634; cv=none; d=zohomail.com; s=zohoarc; b=W4SaraPvrzV5gp/xIE1zVm+mVKB6imy5BiEp6qFthICwcAlKPUkxOZtQ49Ma5fzf+igGW25XUJQn6R0J5z0nPqruW87UY6Q7gqopqYh6wjPf0Hh2/uAt0pGpvGS2vo8ALEGstHRK6PYf0/0HZOiJ5DaYkypdLMcr/iCHxnoQ7UM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695396634; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=e4LAtaTxpPIY+cUiG9L3w0qrtTDg/0NhKrP1vDNuOF8=; b=FmHW4hb40X2A7aa+T3X54l7JjiJk1K2LDp7T9/+Jd2cwciNRQyEeOPc5z7O4Ju7rhg3vUqCppoO6G9aFkPpgT+FIeM5hXzJkuA7GOK+hONnNA73ID2sJ6zleWEuUulJfGq+TuRo//ml/NULCUE8/+KeLu26dkJHE2E09Y9BWjRM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1695396634724972.7344523691069; Fri, 22 Sep 2023 08:30:34 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qji6f-0005XA-Gj; Fri, 22 Sep 2023 11:30:13 -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 1qji6X-0005PV-I1 for qemu-devel@nongnu.org; Fri, 22 Sep 2023 11:30:06 -0400 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qji6J-00007g-1m for qemu-devel@nongnu.org; Fri, 22 Sep 2023 11:30:05 -0400 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-4053cb57f02so10477375e9.1 for ; Fri, 22 Sep 2023 08:29:50 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id c22-20020a05600c171600b00405442edc69sm777137wmn.14.2023.09.22.08.29.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Sep 2023 08:29:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1695396589; x=1696001389; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=e4LAtaTxpPIY+cUiG9L3w0qrtTDg/0NhKrP1vDNuOF8=; b=FG2juzi6BuwJZSfCnY93VL+yYmcYVOVjIa8g7tw4C0VdV/LA3JIhNStcVNQNV72AIN rUh6cx9WmI+SpX21JTr55bxTRI5KMbNcYJX6GyBhpNpIti81JKGXwykggH9KZv3aYUz5 y0sMhYv/2ch+UZSJSt3gfjWSQtY/KPNn05kZPOr4LuKVf4SOuvBal6sown7phtHU0d9C qiq9hFGJKuyGWZ4Fdo8iMS3dw6lqxnkl+uSUM0Ns2XTVlLA87Arhy1BEuhr5q5894zmJ Vs81rqzBTfeU9jmt2xHNwX9QvqjhG9KJUQyoNM4Ybczn3xqJfsBUkS/vwIljiY0uA3lg 3Hjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695396589; x=1696001389; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=e4LAtaTxpPIY+cUiG9L3w0qrtTDg/0NhKrP1vDNuOF8=; b=EDLmVimppuQjS85LR+npX1UmdgapHDaGidrehHI80BKNcAHFTIgQOpJ/1+p4Hm2uMk gLg/ckSEqP05oiTUobzixVuueA8uWnq3++TG0bvYkrKyb+nk3Jkhxknm46qYCWzaW2SP 3Qgp2dlHJpqBy4ewTX5LOm6cuN1m2lVWEv6rFMtt1JMvG8t7uF2hfcmSbyiFJDp+Esfj 1aSrKz3BPQey/6Wn1on8vePk+szr94V8ezf5MMFWPdkb5FCxIM53EcbO7pFyKgwDF1oA XUHs3HbXtanabeWY0i7RJzHu1eTj5RCDaNRcnHn0nZmoJoMl7WRwcYmjrntH5NSDK7Sl LZOg== X-Gm-Message-State: AOJu0Yyseyri23OWt2U8y9Y8tj8dEr2KmX50vPY2wPfG+Zx+mrjHNIQc QeRGKj/P1l+cn7H0/9KTjivDIbLWYzRE/SDmiyI= X-Google-Smtp-Source: AGHT+IFsdXN0nvTEAHWVm9ZqJujXKta3UfSgAFcF+cS3zC3zyoWy3uCUPqjH4uAVFsenD/1tL0MoRA== X-Received: by 2002:a7b:cd9a:0:b0:3fe:5053:1a0b with SMTP id y26-20020a7bcd9a000000b003fe50531a0bmr7723989wmj.11.1695396589732; Fri, 22 Sep 2023 08:29:49 -0700 (PDT) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Eric Auger , Markus Armbruster Subject: [PATCH 3/4] hw/arm/smmuv3.c: Avoid shadowing variable Date: Fri, 22 Sep 2023 16:29:43 +0100 Message-Id: <20230922152944.3583438-4-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230922152944.3583438-1-peter.maydell@linaro.org> References: <20230922152944.3583438-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1695396636410100003 Avoid shadowing a variable in smmuv3_notify_iova(): ../../hw/arm/smmuv3.c: In function =E2=80=98smmuv3_notify_iova=E2=80=99: ../../hw/arm/smmuv3.c:1043:23: warning: declaration of =E2=80=98event=E2=80= =99 shadows a previous local [-Wshadow=3Dlocal] 1043 | SMMUEventInfo event =3D {.inval_ste_allowed =3D true}; | ^~~~~ ../../hw/arm/smmuv3.c:1038:19: note: shadowed declaration is here 1038 | IOMMUTLBEvent event; | ^~~~~ Signed-off-by: Peter Maydell Reviewed-by: Eric Auger Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/arm/smmuv3.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/arm/smmuv3.c b/hw/arm/smmuv3.c index 1e9be8e89af..6f2b2bd45f9 100644 --- a/hw/arm/smmuv3.c +++ b/hw/arm/smmuv3.c @@ -1040,8 +1040,8 @@ static void smmuv3_notify_iova(IOMMUMemoryRegion *mr, SMMUv3State *s =3D sdev->smmu; =20 if (!tg) { - SMMUEventInfo event =3D {.inval_ste_allowed =3D true}; - SMMUTransCfg *cfg =3D smmuv3_get_config(sdev, &event); + SMMUEventInfo eventinfo =3D {.inval_ste_allowed =3D true}; + SMMUTransCfg *cfg =3D smmuv3_get_config(sdev, &eventinfo); SMMUTransTableInfo *tt; =20 if (!cfg) { --=20 2.34.1 From nobody Fri May 17 23:37:31 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1695396660; cv=none; d=zohomail.com; s=zohoarc; b=c8RNH7UTJzXa/glIs/mpDRxPlhrPs88Q5/1/8ss6K1G4ukDA+sguxs1oLXh7Nm90sPAMMIM3/ozlxWyCGfp8f29ms0zmc7kEp+TzApzMQIPXXTOovT0MelpSSx+9xOE+UUqE6VqmdvgX5Ht0CMiG1C7R3dOE+OYkufN5gPSq1Qg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695396660; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=m9TrjKf7+kxYBayfyROE1MR4UI5QgzR2WS5tLK6UIm4=; b=k6tAMM3tljyx1k+/ZCAthBb3WCvyaSNFuo2EWVxVRWxWB4PpwpO7RxMIGgmA+x5KamF1iVvPEYC1VRo8JSpQ/Ayp5rBR1+C2CnAotgDU2aqzIK3QlDUYuPoEQD976x9EtDdVzhMBzdUi33pWN9pFEHDaYpx7bm43oRjfZrpyBrg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1695396660527555.7777843620968; Fri, 22 Sep 2023 08:31:00 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qji6i-0005jI-Bk; Fri, 22 Sep 2023 11:30:16 -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 1qji6Q-0005Ls-S0 for qemu-devel@nongnu.org; Fri, 22 Sep 2023 11:29:59 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qji6L-00007s-TW for qemu-devel@nongnu.org; Fri, 22 Sep 2023 11:29:58 -0400 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-401b393ddd2so23677145e9.0 for ; Fri, 22 Sep 2023 08:29:53 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id c22-20020a05600c171600b00405442edc69sm777137wmn.14.2023.09.22.08.29.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Sep 2023 08:29:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1695396590; x=1696001390; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=m9TrjKf7+kxYBayfyROE1MR4UI5QgzR2WS5tLK6UIm4=; b=gxdCQcAl26n6oLCkV8rJbrd/zKvz1ZPuKGHpnmyZ+4LL8Jc28cJ88byRm1DVO4aRuf fKrmYfRw+6LAXmTokbYccj4FfphiymMftWWTbSPiHGPmZbj9/2smtS7Y1lCbzGtF333x SiFn+Iz5iGA+bC1CgG3dvpsBUFG11bMWrI4QqRZW8XymNrsbIXCN1JmAZ5qMiap3EBjL huy6menTPryw7XBu2Gn1Ui2pHmKAMFrzfOiNz8QxtUUBafxBEeUV6cp4A+oNCx+J0ea2 Fxxb45u9+utOYoVtPbEbR9z/3xHwkf9xDW8Y7kqetrraa8AaMoA74SlpWZVBpesFTDkq Cmkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695396590; x=1696001390; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=m9TrjKf7+kxYBayfyROE1MR4UI5QgzR2WS5tLK6UIm4=; b=UKFiOh8Sp9DsDp3vypPssJ/ubG62QFIpeB1NDyjTJrrikGlh7ExxeglUitx1eFcA2L yjjFKprCXdjlbkK1KdnLU2+0b8yjWRVkG7gzAIL/0tbrN/a0lOKRYW0M2UQuh40nnBqk HowFiAenbaD7s2sNdfcNE7Poenhx1F4iVrjcvMI7eCe5yEv+JAnox8FQGwEqI9ncjkOS /Uq2Nm3g2HRNtOEqrSwkeq5pnTSw25p3z380t2GoKEy8VGYFX+ETXa1DZ+WZ+Yn4BSbW DROhh2mBiwegcr/D+Jwa4APAT9OdeJqSXVbO4KJclzESdLwgPQzsjUKZa+C8QSb65r7d ZQPg== X-Gm-Message-State: AOJu0Yzo0/H7A/9MHddmVqKbrgCN6efx3UCEgU1TDRDm4cUShVIyBcSh kEdDv9dKibo1fP2SZtmJH/2+bWLle4U4mwcF+Ow= X-Google-Smtp-Source: AGHT+IHd6y2OMEGLWSGiWu1ammx2xjYI2LjaZoo+HSPd3pv7wZHZC3VFPeXJLkCrzb374h60B3eOag== X-Received: by 2002:a05:600c:205a:b0:402:e68f:888c with SMTP id p26-20020a05600c205a00b00402e68f888cmr7797897wmg.7.1695396590217; Fri, 22 Sep 2023 08:29:50 -0700 (PDT) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Eric Auger , Markus Armbruster Subject: [PATCH 4/4] hw/arm/smmuv3-internal.h: Don't use locals in statement macros Date: Fri, 22 Sep 2023 16:29:44 +0100 Message-Id: <20230922152944.3583438-5-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230922152944.3583438-1-peter.maydell@linaro.org> References: <20230922152944.3583438-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x331.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1695396662613100003 The STE_CTXPTR() and STE_S2TTB() macros both extract two halves of an address from fields in the STE and combine them into a single value to return. The current code for this uses a GCC statement expression. There are two problems with this: (1) The type chosen for the variable in the statement expr is 'unsigned long', which might not be 64 bits (2) the name chosen for the variable causes -Wshadow warnings because it's the same as a variable in use at the callsite: In file included from ../../hw/arm/smmuv3.c:34: ../../hw/arm/smmuv3.c: In function =E2=80=98smmu_get_cd=E2=80=99: ../../hw/arm/smmuv3-internal.h:538:23: warning: declaration of =E2=80=98add= r=E2=80=99 shadows a previous local [-Wshadow=3Dcompatible-local] 538 | unsigned long addr; \ | ^~~~ ../../hw/arm/smmuv3.c:339:23: note: in expansion of macro =E2=80=98STE_CTXP= TR=E2=80=99 339 | dma_addr_t addr =3D STE_CTXPTR(ste); | ^~~~~~~~~~ ../../hw/arm/smmuv3.c:339:16: note: shadowed declaration is here 339 | dma_addr_t addr =3D STE_CTXPTR(ste); | ^~~~ Sidestep both of these problems by just using a single expression rather than a statement expr. For CMD_ADDR, we got the type of the variable right but still run into -Wshadow problems: In file included from ../../hw/arm/smmuv3.c:34: ../../hw/arm/smmuv3.c: In function =E2=80=98smmuv3_range_inval=E2=80=99: ../../hw/arm/smmuv3-internal.h:334:22: warning: declaration of =E2=80=98add= r=E2=80=99 shadows a previous local [-Wshadow=3Dcompatible-local] 334 | uint64_t addr =3D high << 32 | (low << 12); \ | ^~~~ ../../hw/arm/smmuv3.c:1104:28: note: in expansion of macro =E2=80=98CMD_ADD= R=E2=80=99 1104 | dma_addr_t end, addr =3D CMD_ADDR(cmd); | ^~~~~~~~ ../../hw/arm/smmuv3.c:1104:21: note: shadowed declaration is here 1104 | dma_addr_t end, addr =3D CMD_ADDR(cmd); | ^~~~ so convert it too. CD_TTB has neither problem, but it is the only other macro in the file that uses this pattern, so we convert it also for consistency's sake. We use extract64() rather than extract32() to avoid having to explicitly cast the result to uint64_t. Signed-off-by: Peter Maydell Reviewed-by: Eric Auger --- hw/arm/smmuv3-internal.h | 41 +++++++++++++--------------------------- 1 file changed, 13 insertions(+), 28 deletions(-) diff --git a/hw/arm/smmuv3-internal.h b/hw/arm/smmuv3-internal.h index 6d1c1edab7b..648c2e37a27 100644 --- a/hw/arm/smmuv3-internal.h +++ b/hw/arm/smmuv3-internal.h @@ -328,12 +328,9 @@ enum { /* Command completion notification */ #define CMD_TTL(x) extract32((x)->word[2], 8 , 2) #define CMD_TG(x) extract32((x)->word[2], 10, 2) #define CMD_STE_RANGE(x) extract32((x)->word[2], 0 , 5) -#define CMD_ADDR(x) ({ \ - uint64_t high =3D (uint64_t)(x)->word[3]; \ - uint64_t low =3D extract32((x)->word[2], 12, 20); \ - uint64_t addr =3D high << 32 | (low << 12); \ - addr; \ - }) +#define CMD_ADDR(x) \ + (((uint64_t)((x)->word[3]) << 32) | \ + ((extract64((x)->word[2], 12, 20)) << 12)) =20 #define SMMU_FEATURE_2LVL_STE (1 << 0) =20 @@ -533,21 +530,13 @@ typedef struct CD { #define STE_S2S(x) extract32((x)->word[5], 25, 1) #define STE_S2R(x) extract32((x)->word[5], 26, 1) =20 -#define STE_CTXPTR(x) \ - ({ \ - unsigned long addr; \ - addr =3D (uint64_t)extract32((x)->word[1], 0, 16) << 32; \ - addr |=3D (uint64_t)((x)->word[0] & 0xffffffc0); \ - addr; \ - }) +#define STE_CTXPTR(x) \ + ((extract64((x)->word[1], 0, 16) << 32) | \ + ((x)->word[0] & 0xffffffc0)) =20 -#define STE_S2TTB(x) \ - ({ \ - unsigned long addr; \ - addr =3D (uint64_t)extract32((x)->word[7], 0, 16) << 32; \ - addr |=3D (uint64_t)((x)->word[6] & 0xfffffff0); \ - addr; \ - }) +#define STE_S2TTB(x) \ + ((extract64((x)->word[7], 0, 16) << 32) | \ + ((x)->word[6] & 0xfffffff0)) =20 static inline int oas2bits(int oas_field) { @@ -585,14 +574,10 @@ static inline int pa_range(STE *ste) =20 #define CD_VALID(x) extract32((x)->word[0], 31, 1) #define CD_ASID(x) extract32((x)->word[1], 16, 16) -#define CD_TTB(x, sel) \ - ({ \ - uint64_t hi, lo; \ - hi =3D extract32((x)->word[(sel) * 2 + 3], 0, 19); \ - hi <<=3D 32; \ - lo =3D (x)->word[(sel) * 2 + 2] & ~0xfULL; \ - hi | lo; \ - }) +#define CD_TTB(x, sel) \ + ((extract64((x)->word[(sel) * 2 + 3], 0, 19) << 32) | \ + ((x)->word[(sel) * 2 + 2] & ~0xfULL)) + #define CD_HAD(x, sel) extract32((x)->word[(sel) * 2 + 2], 1, 1) =20 #define CD_TSZ(x, sel) extract32((x)->word[0], (16 * (sel)) + 0, 6) --=20 2.34.1