From nobody Fri May 17 11:29:14 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1695977485; cv=none; d=zohomail.com; s=zohoarc; b=DA7j2W+GkOEvW907QKU8WmaKzQUBZ1uQ2fLyLtzvykCwP1oEHE7a47w/eUUtqyGCiEkNN6XdnYRhSUuLv5TzJ7T0Eb+rhMcHEuTLbAhL3KuU5W1UITG+3W1Et74idgisY6SjRDhsrl2EjbOGFwZQKh6XMcVkoE2/p3bHOr/1Rcc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695977485; 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=trHYAZUJZwtXGg9UDoRzU7sOQBIeaFjkI1WIg2w0pQc=; b=QaLKXY+lGYbfuuA0AL7emgNy/wGqYXeH/GQyBDMEGrqB9SHNzhDxnCORcwTNeulYPreQJu68qTwC79Y2C0lyvEMfzBkhqWTHmAj5RuzDW9DalY29mxmEMh33aq5MQNmyMJqGI8V0MOVzZwT3Kx2kr9RARI/W1j2isKIHJwzUqIw= 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 1695977485064132.09825732967056; Fri, 29 Sep 2023 01:51:25 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qm9DG-0004w8-OR; Fri, 29 Sep 2023 04:51:08 -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 1qm9DD-0004vm-Dp for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:03 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qm9D7-0005ai-ME for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:01 -0400 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-362-A3md13wnM7Gv3PNvLCtOsw-1; Fri, 29 Sep 2023 04:50:54 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 699F03C025C7; Fri, 29 Sep 2023 08:50:54 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 47939492B16; Fri, 29 Sep 2023 08:50:54 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 52C2221E6905; Fri, 29 Sep 2023 10:50:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695977456; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=trHYAZUJZwtXGg9UDoRzU7sOQBIeaFjkI1WIg2w0pQc=; b=RXGcr+2k2NVAckw9p/fSA7CV/0BMDIn8wwgB/YhkKOdEtgZ75zz6K+KfPL1g448vQQG/i2 L0fJBNe7Vb2Cfsc5Niz0eXPR1684k0W8AkcFX9l25Cg4KX/2UfoJW6zSh4Y17Qz3dQ41yb GHjkTe9J3UJmJTz+JFNqrL4Densl90Y= X-MC-Unique: A3md13wnM7Gv3PNvLCtOsw-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, Eric Blake , Peter Xu , Li Zhijian Subject: [PULL 01/56] migration/rdma: Fix save_page method to fail on polling error Date: Fri, 29 Sep 2023 10:49:58 +0200 Message-ID: <20230929085053.2789105-2-armbru@redhat.com> In-Reply-To: <20230929085053.2789105-1-armbru@redhat.com> References: <20230929085053.2789105-1-armbru@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 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=170.10.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_SBL_CSS=3.335, 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 @redhat.com) X-ZM-MESSAGEID: 1695977487566100003 Content-Type: text/plain; charset="utf-8" qemu_rdma_save_page() reports polling error with error_report(), then succeeds anyway. This is because the variable holding the polling status *shadows* the variable the function returns. The latter remains zero. Broken since day one, and duplicated more recently. Fixes: 2da776db4846 (rdma: core logic) Fixes: b390afd8c50b (migration/rdma: Fix out of order wrid) Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Reviewed-by: Peter Xu Reviewed-by: Li Zhijian Message-ID: <20230921121312.1301864-2-armbru@redhat.com> --- migration/rdma.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/migration/rdma.c b/migration/rdma.c index a2a3db35b1..3915d1d7c9 100644 --- a/migration/rdma.c +++ b/migration/rdma.c @@ -3282,7 +3282,8 @@ static size_t qemu_rdma_save_page(QEMUFile *f, */ while (1) { uint64_t wr_id, wr_id_in; - int ret =3D qemu_rdma_poll(rdma, rdma->recv_cq, &wr_id_in, NULL); + ret =3D qemu_rdma_poll(rdma, rdma->recv_cq, &wr_id_in, NULL); + if (ret < 0) { error_report("rdma migration: polling error! %d", ret); goto err; @@ -3297,7 +3298,8 @@ static size_t qemu_rdma_save_page(QEMUFile *f, =20 while (1) { uint64_t wr_id, wr_id_in; - int ret =3D qemu_rdma_poll(rdma, rdma->send_cq, &wr_id_in, NULL); + ret =3D qemu_rdma_poll(rdma, rdma->send_cq, &wr_id_in, NULL); + if (ret < 0) { error_report("rdma migration: polling error! %d", ret); goto err; --=20 2.41.0 From nobody Fri May 17 11:29:14 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1695977634; cv=none; d=zohomail.com; s=zohoarc; b=GuPPrEDp77BltpzZbfZVY/1ju7ctHPCsdRZffKrUmjgQ2XWrruydK6FKxtK1wa8KKkvrGQHeBIm0r8H2VpbzEDIPPmk3hTgD0iUEXa27JfgsXi7M4e6cIty8CUS/zLwx8yNAbT5uX88On7HXyuznuUgRslD4/D57adA7EJNt5eU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695977634; 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=UqFUs23KCzXHLT1WGaC+QPUfscLWSpJ7WEYcXTH+iqA=; b=Jh7UxTBJxuNZc9hN5fCzeQByMTOHSL34iXQ6BTWycehb6DWWQHnVgmFxpRIuSDZqCt/5QtnQ7okxORNyK4FmY2Pt/qtHFI+entmkOTny9ZisOAJ0dEDMFPL/1ZdRlvJtrdD06fbvmM+I7sILnrA9q7v0I66IT8KcKryR7/0e28Q= 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 1695977634695246.4227444891137; Fri, 29 Sep 2023 01:53:54 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qm9DW-00053I-LX; Fri, 29 Sep 2023 04:51:22 -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 1qm9DM-0004xr-Dc for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:13 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qm9D8-0005ad-1N for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:10 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-362-pO1NdOOiNsGoFpbIq36LVA-1; Fri, 29 Sep 2023 04:50:54 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 72C51101A550; Fri, 29 Sep 2023 08:50:54 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 500482026D68; Fri, 29 Sep 2023 08:50:54 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 55BC321E6906; Fri, 29 Sep 2023 10:50:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695977456; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UqFUs23KCzXHLT1WGaC+QPUfscLWSpJ7WEYcXTH+iqA=; b=hKevBmflF0yYjB9dR2x5+K0qLOrhUOSfkK6GkeOamVN880UPEmFe5qOeIlP4sTyroQvcBh 0YGOIMtjzkK2nJgW4bai80e9L1xwSjBmcGJ4nf85WaBic0+DeMhUhOFr079N5qJ71hN20e w9MmL5Ujr8YJ/7CGnBiBkAYZ/SZmtSk= X-MC-Unique: pO1NdOOiNsGoFpbIq36LVA-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, Peter Xu , Li Zhijian Subject: [PULL 02/56] migration: Clean up local variable shadowing Date: Fri, 29 Sep 2023 10:49:59 +0200 Message-ID: <20230929085053.2789105-3-armbru@redhat.com> In-Reply-To: <20230929085053.2789105-1-armbru@redhat.com> References: <20230929085053.2789105-1-armbru@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 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=170.10.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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 @redhat.com) X-ZM-MESSAGEID: 1695977636174100008 Content-Type: text/plain; charset="utf-8" Local variables shadowing other local variables or parameters make the code needlessly hard to understand. Tracked down with -Wshadow=3Dlocal. Clean up: delete inner declarations when they are actually redundant, else rename variables. Signed-off-by: Markus Armbruster Reviewed-by: Peter Xu Reviewed-by: Li Zhijian Message-ID: <20230921121312.1301864-3-armbru@redhat.com> --- migration/block.c | 4 ++-- migration/ram.c | 8 +++----- migration/rdma.c | 8 +++++--- migration/vmstate.c | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/migration/block.c b/migration/block.c index 86c2256a2b..eb6aafeb9e 100644 --- a/migration/block.c +++ b/migration/block.c @@ -440,8 +440,8 @@ static int init_blk_migration(QEMUFile *f) /* Can only insert new BDSes now because doing so while iterating block * devices may end up in a deadlock (iterating the new BDSes, too). */ for (i =3D 0; i < num_bs; i++) { - BlkMigDevState *bmds =3D bmds_bs[i].bmds; - BlockDriverState *bs =3D bmds_bs[i].bs; + bmds =3D bmds_bs[i].bmds; + bs =3D bmds_bs[i].bs; =20 if (bmds) { ret =3D blk_insert_bs(bmds->blk, bs, &local_err); diff --git a/migration/ram.c b/migration/ram.c index 9040d66e61..0c202f8109 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -3517,8 +3517,6 @@ int colo_init_ram_cache(void) * we use the same name 'ram_bitmap' as for migration. */ if (ram_bytes_total()) { - RAMBlock *block; - RAMBLOCK_FOREACH_NOT_IGNORED(block) { unsigned long pages =3D block->max_length >> TARGET_PAGE_BITS; block->bmap =3D bitmap_new(pages); @@ -3998,12 +3996,12 @@ static int ram_load_precopy(QEMUFile *f) } } if (migrate_ignore_shared()) { - hwaddr addr =3D qemu_get_be64(f); + hwaddr addr2 =3D qemu_get_be64(f); if (migrate_ram_is_ignored(block) && - block->mr->addr !=3D addr) { + block->mr->addr !=3D addr2) { error_report("Mismatched GPAs for block %s " "%" PRId64 "!=3D %" PRId64, - id, (uint64_t)addr, + id, (uint64_t)addr2, (uint64_t)block->mr->addr); ret =3D -EINVAL; } diff --git a/migration/rdma.c b/migration/rdma.c index 3915d1d7c9..c78ddfcb74 100644 --- a/migration/rdma.c +++ b/migration/rdma.c @@ -1902,9 +1902,11 @@ static int qemu_rdma_exchange_send(RDMAContext *rdma= , RDMAControlHeader *head, * by waiting for a READY message. */ if (rdma->control_ready_expected) { - RDMAControlHeader resp; - ret =3D qemu_rdma_exchange_get_response(rdma, - &resp, RDMA_CONTROL_READY, RDMA_WRID_R= EADY); + RDMAControlHeader resp_ignored; + + ret =3D qemu_rdma_exchange_get_response(rdma, &resp_ignored, + RDMA_CONTROL_READY, + RDMA_WRID_READY); if (ret < 0) { return ret; } diff --git a/migration/vmstate.c b/migration/vmstate.c index 31842c3afb..438ea77cfa 100644 --- a/migration/vmstate.c +++ b/migration/vmstate.c @@ -97,7 +97,7 @@ int vmstate_load_state(QEMUFile *f, const VMStateDescript= ion *vmsd, return -EINVAL; } if (vmsd->pre_load) { - int ret =3D vmsd->pre_load(opaque); + ret =3D vmsd->pre_load(opaque); if (ret) { return ret; } --=20 2.41.0 From nobody Fri May 17 11:29:14 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1695977510; cv=none; d=zohomail.com; s=zohoarc; b=Yx/b5iKy1U3isT5/zjCAzzYWUuwXtCB3V8IG0fSzgv1C+Lgww5ACjB7NdlnRnT+q54s7WYacJwAmF+VPyI/BXwhBYBXb7IK3WMd1dAueZ8/TBcn95Q2uU1hY8PCrBD+RfBO3cfzvk2Cbrgl1yvyeMVbTU6vGN+JJNkQfhrKujcg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695977510; 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=yStjAP0Z0StsEMR9idifIso3CILLPARxLjU7OAkmRQ4=; b=M8ZBkdiNwEVannnXlJzcD4p/o2MclU0f+XnWtdVy9NHuRGuFga1rVebQdrSELVA/hogvHupMTt3zxZq+6KeaCtUKMPCsH7GJChoM5frH8kEMqFCZMnwFcDKEQyBsNAAJEHOj07E+cqlygGsGX0YM8ODlnL9p6imxUAzlNUYyrAQ= 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 1695977510634222.41254708058727; Fri, 29 Sep 2023 01:51:50 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qm9DM-0004y2-Lj; Fri, 29 Sep 2023 04:51:12 -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 1qm9DH-0004wg-V4 for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:08 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qm9D9-0005bD-KQ for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:07 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-557-eDm17OjxN4CPn9_KxbSjzw-1; Fri, 29 Sep 2023 04:50:55 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C5473101AA44; Fri, 29 Sep 2023 08:50:54 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8751F2026D4B; Fri, 29 Sep 2023 08:50:54 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 5873D21E690B; Fri, 29 Sep 2023 10:50:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695977458; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yStjAP0Z0StsEMR9idifIso3CILLPARxLjU7OAkmRQ4=; b=SEEqho1OtVZUhhhcv66zl1+xUsHQwQEWdW65AIi+MLYNtkx4A/JZWmU7p8qHhkgrWpwC6v F4krTZ7vMdXvowg8ZUPYFbFb+akOS8+yugjZuS50Xs2qF27LmA8jqmX2pBe79F4xsDjlFz H1ecVFdDCe7t8umimLhMCBaUrGeb0bU= X-MC-Unique: eDm17OjxN4CPn9_KxbSjzw-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, Peter Maydell Subject: [PULL 03/56] ui: Clean up local variable shadowing Date: Fri, 29 Sep 2023 10:50:00 +0200 Message-ID: <20230929085053.2789105-4-armbru@redhat.com> In-Reply-To: <20230929085053.2789105-1-armbru@redhat.com> References: <20230929085053.2789105-1-armbru@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 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=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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 @redhat.com) X-ZM-MESSAGEID: 1695977511635100001 Content-Type: text/plain; charset="utf-8" Local variables shadowing other local variables or parameters make the code needlessly hard to understand. Tracked down with -Wshadow=3Dlocal. Clean up: delete inner declarations when they are actually redundant, else rename variables. Signed-off-by: Markus Armbruster Reviewed-by: Peter Maydell Message-ID: <20230921121312.1301864-4-armbru@redhat.com> --- ui/gtk.c | 14 +++++++------- ui/spice-display.c | 9 +++++---- ui/vnc-palette.c | 2 -- ui/vnc.c | 12 ++++++------ ui/vnc-enc-zrle.c.inc | 9 ++++----- 5 files changed, 22 insertions(+), 24 deletions(-) diff --git a/ui/gtk.c b/ui/gtk.c index e09f97a86b..3373427c9b 100644 --- a/ui/gtk.c +++ b/ui/gtk.c @@ -930,8 +930,8 @@ static gboolean gd_motion_event(GtkWidget *widget, GdkE= ventMotion *motion, GdkMonitor *monitor =3D gdk_display_get_monitor_at_window(dpy, win= ); GdkRectangle geometry; =20 - int x =3D (int)motion->x_root; - int y =3D (int)motion->y_root; + int xr =3D (int)motion->x_root; + int yr =3D (int)motion->y_root; =20 gdk_monitor_get_geometry(monitor, &geometry); =20 @@ -942,13 +942,13 @@ static gboolean gd_motion_event(GtkWidget *widget, Gd= kEventMotion *motion, * may still be only half way across the screen. Without * this warp, the server pointer would thus appear to hit * an invisible wall */ - if (x <=3D geometry.x || x - geometry.x >=3D geometry.width - 1 || - y <=3D geometry.y || y - geometry.y >=3D geometry.height - 1) { + if (xr <=3D geometry.x || xr - geometry.x >=3D geometry.width - 1 = || + yr <=3D geometry.y || yr - geometry.y >=3D geometry.height - 1= ) { GdkDevice *dev =3D gdk_event_get_device((GdkEvent *)motion); - x =3D geometry.x + geometry.width / 2; - y =3D geometry.y + geometry.height / 2; + xr =3D geometry.x + geometry.width / 2; + yr =3D geometry.y + geometry.height / 2; =20 - gdk_device_warp(dev, screen, x, y); + gdk_device_warp(dev, screen, xr, yr); s->last_set =3D FALSE; return FALSE; } diff --git a/ui/spice-display.c b/ui/spice-display.c index 5cc47bd668..6eb98a5a5c 100644 --- a/ui/spice-display.c +++ b/ui/spice-display.c @@ -1081,15 +1081,16 @@ static void qemu_spice_gl_update(DisplayChangeListe= ner *dcl, } =20 if (render_cursor) { - int x, y; + int ptr_x, ptr_y; + qemu_mutex_lock(&ssd->lock); - x =3D ssd->ptr_x; - y =3D ssd->ptr_y; + ptr_x =3D ssd->ptr_x; + ptr_y =3D ssd->ptr_y; qemu_mutex_unlock(&ssd->lock); egl_texture_blit(ssd->gls, &ssd->blit_fb, &ssd->guest_fb, !y_0_top); egl_texture_blend(ssd->gls, &ssd->blit_fb, &ssd->cursor_fb, - !y_0_top, x, y, 1.0, 1.0); + !y_0_top, ptr_x, ptr_y, 1.0, 1.0); glFlush(); } =20 diff --git a/ui/vnc-palette.c b/ui/vnc-palette.c index dc7c0ba997..4e88c412f0 100644 --- a/ui/vnc-palette.c +++ b/ui/vnc-palette.c @@ -86,8 +86,6 @@ int palette_put(VncPalette *palette, uint32_t color) return 0; } if (!entry) { - VncPaletteEntry *entry; - entry =3D &palette->pool[palette->size]; entry->color =3D color; entry->idx =3D idx; diff --git a/ui/vnc.c b/ui/vnc.c index c302bb07a5..523eb1f5b0 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -1584,15 +1584,15 @@ static void vnc_jobs_bh(void *opaque) */ static int vnc_client_read(VncState *vs) { - size_t ret; + size_t sz; =20 #ifdef CONFIG_VNC_SASL if (vs->sasl.conn && vs->sasl.runSSF) - ret =3D vnc_client_read_sasl(vs); + sz =3D vnc_client_read_sasl(vs); else #endif /* CONFIG_VNC_SASL */ - ret =3D vnc_client_read_plain(vs); - if (!ret) { + sz =3D vnc_client_read_plain(vs); + if (!sz) { if (vs->disconnecting) { vnc_disconnect_finish(vs); return -1; @@ -3118,8 +3118,8 @@ static int vnc_refresh_server_surface(VncDisplay *vd) cmp_bytes =3D MIN(VNC_DIRTY_PIXELS_PER_BIT * VNC_SERVER_FB_BYTES, server_stride); if (vd->guest.format !=3D VNC_SERVER_FB_FORMAT) { - int width =3D pixman_image_get_width(vd->server); - tmpbuf =3D qemu_pixman_linebuf_create(VNC_SERVER_FB_FORMAT, width); + int w =3D pixman_image_get_width(vd->server); + tmpbuf =3D qemu_pixman_linebuf_create(VNC_SERVER_FB_FORMAT, w); } else { int guest_bpp =3D PIXMAN_FORMAT_BPP(pixman_image_get_format(vd->guest.fb)); diff --git a/ui/vnc-enc-zrle.c.inc b/ui/vnc-enc-zrle.c.inc index a8ca37d05e..2ef7501d52 100644 --- a/ui/vnc-enc-zrle.c.inc +++ b/ui/vnc-enc-zrle.c.inc @@ -153,11 +153,12 @@ static void ZRLE_ENCODE_TILE(VncState *vs, ZRLE_PIXEL= *data, int w, int h, } =20 if (use_rle) { - ZRLE_PIXEL *ptr =3D data; - ZRLE_PIXEL *end =3D ptr + w * h; ZRLE_PIXEL *run_start; ZRLE_PIXEL pix; =20 + ptr =3D data; + end =3D ptr + w * h; + while (ptr < end) { int len; int index =3D 0; @@ -198,7 +199,7 @@ static void ZRLE_ENCODE_TILE(VncState *vs, ZRLE_PIXEL *= data, int w, int h, } } else if (use_palette) { /* no RLE */ int bppp; - ZRLE_PIXEL *ptr =3D data; + ptr =3D data; =20 /* packed pixels */ =20 @@ -241,8 +242,6 @@ static void ZRLE_ENCODE_TILE(VncState *vs, ZRLE_PIXEL *= data, int w, int h, #endif { #ifdef ZRLE_COMPACT_PIXEL - ZRLE_PIXEL *ptr; - for (ptr =3D data; ptr < data + w * h; ptr++) { ZRLE_WRITE_PIXEL(vs, *ptr); } --=20 2.41.0 From nobody Fri May 17 11:29:14 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1695977747; cv=none; d=zohomail.com; s=zohoarc; b=hIHH8ZX8LIowXzc9cT/QZ+bQFCtEe9Odddi0VuAYsgrQwzmYqy0BkF1echrM6oAMHknWmVaSBAAsuElHlf6SB+6DDUjmv04HRnNWYGrSnmgerH6zjyR72uHMMgb1zlfWPE9EJZO11rihva/1Ce3i37gq6i/mMjZWUIJ8OjttjdI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695977747; 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=Y4otJMtuOYgwSMwM9aP6q2uWi5OdTkPSIruBqZNSp0k=; b=ksfHuSKz7+5n1IwriS9WINnsDE6Fnh8ibmKxjTc7fZGGHgJ8/fy5D3ghzWzu6EeL0TjtJOSti3Xt1Lc27nxAzfIrosYj/WdB7YmGhk2reMf2Kwnt5sI/70jJWSeWMbxOdOEFYctf/gVHHAZQoaeQJ85tuok+aSJQ3fJNPY2C0FY= 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 1695977747964478.3944395852658; Fri, 29 Sep 2023 01:55:47 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qm9DY-00056q-CK; Fri, 29 Sep 2023 04:51:24 -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 1qm9DM-0004xy-J4 for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:12 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qm9D9-0005ac-9d for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:12 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-362-t_TV9VDtPuq2N2cHoh8Zgw-1; Fri, 29 Sep 2023 04:50:54 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 85F0C801779 for ; Fri, 29 Sep 2023 08:50:54 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 63208492B05 for ; Fri, 29 Sep 2023 08:50:54 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 5B3E221E690C; Fri, 29 Sep 2023 10:50:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695977456; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Y4otJMtuOYgwSMwM9aP6q2uWi5OdTkPSIruBqZNSp0k=; b=DXLc0Do8GGeARlDRzGYgIqfR93jaKSSRxY8o8VzDLLFLN1bp5fiM2/s1IzDoyDChF1LBqn cSEdAvgkhXLVggEoBlrHEk2Zvux46r5XFTDnUk78F78eb9lWl9Hd+cy1/Wc3L3yTHTvHOf 4hvUh9o/pujJMQ+WBGo1rjT464rBR/g= X-MC-Unique: t_TV9VDtPuq2N2cHoh8Zgw-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, Kevin Wolf Subject: [PULL 04/56] block/dirty-bitmap: Clean up local variable shadowing Date: Fri, 29 Sep 2023 10:50:01 +0200 Message-ID: <20230929085053.2789105-5-armbru@redhat.com> In-Reply-To: <20230929085053.2789105-1-armbru@redhat.com> References: <20230929085053.2789105-1-armbru@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 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=170.10.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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 @redhat.com) X-ZM-MESSAGEID: 1695977748301100001 Content-Type: text/plain; charset="utf-8" Local variables shadowing other local variables or parameters make the code needlessly hard to understand. Tracked down with -Wshadow=3Dlocal. Clean up: rename both the pair of parameters and the pair of local variables. While there, move the local variables to function scope. Suggested-by: Kevin Wolf Signed-off-by: Markus Armbruster Reviewed-by: Kevin Wolf Message-ID: <20230921121312.1301864-5-armbru@redhat.com> --- block/monitor/bitmap-qmp-cmds.c | 19 ++++++++++--------- block/qcow2-bitmap.c | 3 +-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/block/monitor/bitmap-qmp-cmds.c b/block/monitor/bitmap-qmp-cmd= s.c index 55f778f5af..70d01a3776 100644 --- a/block/monitor/bitmap-qmp-cmds.c +++ b/block/monitor/bitmap-qmp-cmds.c @@ -258,37 +258,38 @@ void qmp_block_dirty_bitmap_disable(const char *node,= const char *name, bdrv_disable_dirty_bitmap(bitmap); } =20 -BdrvDirtyBitmap *block_dirty_bitmap_merge(const char *node, const char *ta= rget, +BdrvDirtyBitmap *block_dirty_bitmap_merge(const char *dst_node, + const char *dst_bitmap, BlockDirtyBitmapOrStrList *bms, HBitmap **backup, Error **errp) { BlockDriverState *bs; BdrvDirtyBitmap *dst, *src; BlockDirtyBitmapOrStrList *lst; + const char *src_node, *src_bitmap; HBitmap *local_backup =3D NULL; =20 GLOBAL_STATE_CODE(); =20 - dst =3D block_dirty_bitmap_lookup(node, target, &bs, errp); + dst =3D block_dirty_bitmap_lookup(dst_node, dst_bitmap, &bs, errp); if (!dst) { return NULL; } =20 for (lst =3D bms; lst; lst =3D lst->next) { switch (lst->value->type) { - const char *name, *node; case QTYPE_QSTRING: - name =3D lst->value->u.local; - src =3D bdrv_find_dirty_bitmap(bs, name); + src_bitmap =3D lst->value->u.local; + src =3D bdrv_find_dirty_bitmap(bs, src_bitmap); if (!src) { - error_setg(errp, "Dirty bitmap '%s' not found", name); + error_setg(errp, "Dirty bitmap '%s' not found", src_bitmap= ); goto fail; } break; case QTYPE_QDICT: - node =3D lst->value->u.external.node; - name =3D lst->value->u.external.name; - src =3D block_dirty_bitmap_lookup(node, name, NULL, errp); + src_node =3D lst->value->u.external.node; + src_bitmap =3D lst->value->u.external.name; + src =3D block_dirty_bitmap_lookup(src_node, src_bitmap, NULL, = errp); if (!src) { goto fail; } diff --git a/block/qcow2-bitmap.c b/block/qcow2-bitmap.c index 037fa2d435..ffd5cd3b23 100644 --- a/block/qcow2-bitmap.c +++ b/block/qcow2-bitmap.c @@ -1555,7 +1555,6 @@ bool qcow2_store_persistent_dirty_bitmaps(BlockDriver= State *bs, FOR_EACH_DIRTY_BITMAP(bs, bitmap) { const char *name =3D bdrv_dirty_bitmap_name(bitmap); uint32_t granularity =3D bdrv_dirty_bitmap_granularity(bitmap); - Qcow2Bitmap *bm; =20 if (!bdrv_dirty_bitmap_get_persistence(bitmap) || bdrv_dirty_bitmap_inconsistent(bitmap)) { @@ -1625,7 +1624,7 @@ bool qcow2_store_persistent_dirty_bitmaps(BlockDriver= State *bs, =20 /* allocate clusters and store bitmaps */ QSIMPLEQ_FOREACH(bm, bm_list, entry) { - BdrvDirtyBitmap *bitmap =3D bm->dirty_bitmap; + bitmap =3D bm->dirty_bitmap; =20 if (bitmap =3D=3D NULL || bdrv_dirty_bitmap_readonly(bitmap)) { continue; --=20 2.41.0 From nobody Fri May 17 11:29:14 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1695977669; cv=none; d=zohomail.com; s=zohoarc; b=Ha87VlLOndJNYnEho2yssDp/IkpPmFLXokfleOD8ZHF5Z5tB9ngKRcs7tjcyf0qmVUEfOoBB4pLRxLzkaMBGCs7r1cC2g8yfCOxpelMIZSsTkkdb8IilSOjMy+bKzSVHrVmE23ozl2R3sGEbxlg+eI+eG2plxbpULvln329rhn4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695977669; 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=AdvBa4qTGyIPvbPpH9Y1qQjgn148Pa4Brs8tUkF5otQ=; b=hmhcPJKzxSmAg3icGZKGVc/WaVjPRlGAE8BzQUjToskY4BolLNNR+kFy9oxuqFwxa5mPNSzsaWWwENyxy/9Im+1DdfKVjAgattijNDDBLogINPhpPQdITIpYz7+O2fiB6xRv1VYoyubkkj1VS3HjY5bA+HAUaRVNgqFwuBzhVX8= 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 1695977669818500.6302655816173; Fri, 29 Sep 2023 01:54:29 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qm9DQ-0004zm-8o; Fri, 29 Sep 2023 04:51: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 1qm9DG-0004wZ-TI for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:08 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qm9D8-0005au-90 for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:06 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-45-bQFxHUdQMHC6HguzASSGsQ-1; Fri, 29 Sep 2023 04:50:55 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 77417802C1A for ; Fri, 29 Sep 2023 08:50:55 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5569CC15BB8 for ; Fri, 29 Sep 2023 08:50:55 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 5DFF621E690E; Fri, 29 Sep 2023 10:50:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695977457; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AdvBa4qTGyIPvbPpH9Y1qQjgn148Pa4Brs8tUkF5otQ=; b=R28fUa1+jnxMDCBfYrmi4mbuv8FPteMR37FjePkt4WPxmiPVdgftRl4AkpVmJV8he2xZTP yYZDx6/Uvi6k89ZIkyjeebhCjZTN967tSGCyqW1A9Ab41q6PnwKGdl+wGn0GoTKz/fgZXt /zXN8pi7GoHySihEYpr4njmDqFn4pu8= X-MC-Unique: bQFxHUdQMHC6HguzASSGsQ-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, Kevin Wolf Subject: [PULL 05/56] block/vdi: Clean up local variable shadowing Date: Fri, 29 Sep 2023 10:50:02 +0200 Message-ID: <20230929085053.2789105-6-armbru@redhat.com> In-Reply-To: <20230929085053.2789105-1-armbru@redhat.com> References: <20230929085053.2789105-1-armbru@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 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=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, T_SPF_TEMPERROR=0.01 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 @redhat.com) X-ZM-MESSAGEID: 1695977670997100007 Content-Type: text/plain; charset="utf-8" Local variables shadowing other local variables or parameters make the code needlessly hard to understand. Tracked down with -Wshadow=3Dlocal. Clean up: delete inner declarations when they are actually redundant, else rename variables. Signed-off-by: Markus Armbruster Reviewed-by: Stefan Hajnoczi Reviewed-by: Kevin Wolf Message-ID: <20230921121312.1301864-6-armbru@redhat.com> --- block/vdi.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/block/vdi.c b/block/vdi.c index 6c35309e04..934e1b849b 100644 --- a/block/vdi.c +++ b/block/vdi.c @@ -634,7 +634,6 @@ vdi_co_pwritev(BlockDriverState *bs, int64_t offset, in= t64_t bytes, bmap_entry =3D le32_to_cpu(s->bmap[block_index]); if (!VDI_IS_ALLOCATED(bmap_entry)) { /* Allocate new block and write to it. */ - uint64_t data_offset; qemu_co_rwlock_upgrade(&s->bmap_lock); bmap_entry =3D le32_to_cpu(s->bmap[block_index]); if (VDI_IS_ALLOCATED(bmap_entry)) { @@ -700,7 +699,7 @@ nonallocating_write: /* One or more new blocks were allocated. */ VdiHeader *header; uint8_t *base; - uint64_t offset; + uint64_t bmap_offset; uint32_t n_sectors; =20 g_free(block); @@ -723,11 +722,11 @@ nonallocating_write: bmap_first /=3D (SECTOR_SIZE / sizeof(uint32_t)); bmap_last /=3D (SECTOR_SIZE / sizeof(uint32_t)); n_sectors =3D bmap_last - bmap_first + 1; - offset =3D s->bmap_sector + bmap_first; + bmap_offset =3D s->bmap_sector + bmap_first; base =3D ((uint8_t *)&s->bmap[0]) + bmap_first * SECTOR_SIZE; logout("will write %u block map sectors starting from entry %u\n", n_sectors, bmap_first); - ret =3D bdrv_co_pwrite(bs->file, offset * SECTOR_SIZE, + ret =3D bdrv_co_pwrite(bs->file, bmap_offset * SECTOR_SIZE, n_sectors * SECTOR_SIZE, base, 0); } =20 --=20 2.41.0 From nobody Fri May 17 11:29:14 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1695977815; cv=none; d=zohomail.com; s=zohoarc; b=Zj+/OeJ5XLo/zwtTU63NSUCD6ERRu80yByPUeHvakqJ/VDVRa0BxTad7CuzWVWVZErQh1a0XwzjezpelJZCG9z5oNJ8YZ795OluzUrTsUABVhZb3qBtTkzfIRVBmj7FAUAcyOziOyhlWsXRwHUcQRQ0j9qubDU9ahfSgStYl+Gk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695977815; 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=Bu4E73hA1d2Ocu7VFRJ3Y+ltwZBKomR315Tx+LMzLJw=; b=Vc4Z8O1NuUOBY3b19hQnXvkvI8enS2d9ak72bRPJwmHQPulf9HX9GPO7CFLkWKgSivZsKrfqH+Hm4jARINMEkYr0U+JhM09uhjGldkqAhQj/8pwSllSO2n/G/Bl0kzeE6hwm4gmCD5RhDkwOMIchznrXmaJtMvYPqj+cfBje8ow= 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 1695977815849933.6841138203893; Fri, 29 Sep 2023 01:56:55 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qm9DZ-000587-1E; Fri, 29 Sep 2023 04:51:25 -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 1qm9DL-0004xq-Dt for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:13 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qm9DA-0005bU-99 for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:10 -0400 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-561-LqyIFosyMyyRr8TjuKsRMQ-1; Fri, 29 Sep 2023 04:50:56 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 982513806738; Fri, 29 Sep 2023 08:50:55 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 59A6240C6EBF; Fri, 29 Sep 2023 08:50:55 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 60ECE21E690F; Fri, 29 Sep 2023 10:50:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695977459; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Bu4E73hA1d2Ocu7VFRJ3Y+ltwZBKomR315Tx+LMzLJw=; b=GmryyyTDABX02uGpvnq7sg7dcWEjOY5REcKVQbBrjbLFTgR6jU2mmF2XpvQ7Wer77dU4No g+dB5I55ALb5dulnugi4ci4P6oXMVKyIRNczcD/G0i8ZE3gwUdqyXco1tDDnHj92AyCzcp rAqSQ2df27XdRJmFNQwKvn2L3+Nm2hY= X-MC-Unique: LqyIFosyMyyRr8TjuKsRMQ-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, Anthony PERARD , Ilya Dryomov , Kevin Wolf Subject: [PULL 06/56] block: Clean up local variable shadowing Date: Fri, 29 Sep 2023 10:50:03 +0200 Message-ID: <20230929085053.2789105-7-armbru@redhat.com> In-Reply-To: <20230929085053.2789105-1-armbru@redhat.com> References: <20230929085053.2789105-1-armbru@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 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=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, 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 @redhat.com) X-ZM-MESSAGEID: 1695977817688100007 Content-Type: text/plain; charset="utf-8" Local variables shadowing other local variables or parameters make the code needlessly hard to understand. Tracked down with -Wshadow=3Dlocal. Clean up: delete inner declarations when they are actually redundant, else rename variables. Signed-off-by: Markus Armbruster Reviewed-by: Stefan Hajnoczi Acked-by: Anthony PERARD Acked-by: Ilya Dryomov Reviewed-by: Kevin Wolf Message-ID: <20230921121312.1301864-7-armbru@redhat.com> --- block.c | 9 +++++---- block/rbd.c | 2 +- block/stream.c | 1 - block/vvfat.c | 35 ++++++++++++++++++----------------- hw/block/xen-block.c | 6 +++--- 5 files changed, 27 insertions(+), 26 deletions(-) diff --git a/block.c b/block.c index e7f349b25c..af04c8ac6f 100644 --- a/block.c +++ b/block.c @@ -3072,18 +3072,19 @@ bdrv_attach_child_common(BlockDriverState *child_bs, &local_err); =20 if (ret < 0 && child_class->change_aio_ctx) { - Transaction *tran =3D tran_new(); + Transaction *aio_ctx_tran =3D tran_new(); GHashTable *visited =3D g_hash_table_new(NULL, NULL); bool ret_child; =20 g_hash_table_add(visited, new_child); ret_child =3D child_class->change_aio_ctx(new_child, child_ctx, - visited, tran, NULL); + visited, aio_ctx_tran, + NULL); if (ret_child =3D=3D true) { error_free(local_err); ret =3D 0; } - tran_finalize(tran, ret_child =3D=3D true ? 0 : -1); + tran_finalize(aio_ctx_tran, ret_child =3D=3D true ? 0 : -1); g_hash_table_destroy(visited); } =20 @@ -6208,12 +6209,12 @@ void bdrv_iterate_format(void (*it)(void *opaque, c= onst char *name), QLIST_FOREACH(drv, &bdrv_drivers, list) { if (drv->format_name) { bool found =3D false; - int i =3D count; =20 if (use_bdrv_whitelist && !bdrv_is_whitelisted(drv, read_only)= ) { continue; } =20 + i =3D count; while (formats && i && !found) { found =3D !strcmp(formats[--i], drv->format_name); } diff --git a/block/rbd.c b/block/rbd.c index 978671411e..472ca05cba 100644 --- a/block/rbd.c +++ b/block/rbd.c @@ -1290,7 +1290,7 @@ static int coroutine_fn qemu_rbd_start_co(BlockDriver= State *bs, * operations that exceed the current size. */ if (offset + bytes > s->image_size) { - int r =3D qemu_rbd_resize(bs, offset + bytes); + r =3D qemu_rbd_resize(bs, offset + bytes); if (r < 0) { return r; } diff --git a/block/stream.c b/block/stream.c index e4da214f1f..133cb72fb4 100644 --- a/block/stream.c +++ b/block/stream.c @@ -292,7 +292,6 @@ void stream_start(const char *job_id, BlockDriverState = *bs, /* Make sure that the image is opened in read-write mode */ bs_read_only =3D bdrv_is_read_only(bs); if (bs_read_only) { - int ret; /* Hold the chain during reopen */ if (bdrv_freeze_backing_chain(bs, above_base, errp) < 0) { return; diff --git a/block/vvfat.c b/block/vvfat.c index 0ddc91fc09..856b479c91 100644 --- a/block/vvfat.c +++ b/block/vvfat.c @@ -777,7 +777,6 @@ static int read_directory(BDRVVVFATState* s, int mappin= g_index) while((entry=3Dreaddir(dir))) { unsigned int length=3Dstrlen(dirname)+2+strlen(entry->d_name); char* buffer; - direntry_t* direntry; struct stat st; int is_dot=3D!strcmp(entry->d_name,"."); int is_dotdot=3D!strcmp(entry->d_name,".."); @@ -857,7 +856,7 @@ static int read_directory(BDRVVVFATState* s, int mappin= g_index) =20 /* fill with zeroes up to the end of the cluster */ while(s->directory.next%(0x10*s->sectors_per_cluster)) { - direntry_t* direntry=3Darray_get_next(&(s->directory)); + direntry =3D array_get_next(&(s->directory)); memset(direntry,0,sizeof(direntry_t)); } =20 @@ -1962,24 +1961,24 @@ get_cluster_count_for_direntry(BDRVVVFATState* s, d= irentry_t* direntry, const ch * This is horribly inefficient, but that is okay, since * it is rarely executed, if at all. */ - int64_t offset =3D cluster2sector(s, cluster_num); + int64_t offs =3D cluster2sector(s, cluster_num); =20 vvfat_close_current_file(s); for (i =3D 0; i < s->sectors_per_cluster; i++) { int res; =20 res =3D bdrv_is_allocated(s->qcow->bs, - (offset + i) * BDRV_SECTOR_SIZ= E, + (offs + i) * BDRV_SECTOR_SIZE, BDRV_SECTOR_SIZE, NULL); if (res < 0) { return -1; } if (!res) { - res =3D vvfat_read(s->bs, offset, s->cluster_buffe= r, 1); + res =3D vvfat_read(s->bs, offs, s->cluster_buffer,= 1); if (res) { return -1; } - res =3D bdrv_co_pwrite(s->qcow, offset * BDRV_SECT= OR_SIZE, + res =3D bdrv_co_pwrite(s->qcow, offs * BDRV_SECTOR= _SIZE, BDRV_SECTOR_SIZE, s->cluster_= buffer, 0); if (res < 0) { @@ -2467,8 +2466,9 @@ commit_direntries(BDRVVVFATState* s, int dir_index, i= nt parent_mapping_index) =20 for (c =3D first_cluster; !fat_eof(s, c); c =3D modified_fat_get(s, c)= ) { direntry_t *first_direntry; - void* direntry =3D array_get(&(s->directory), current_dir_index); - int ret =3D vvfat_read(s->bs, cluster2sector(s, c), direntry, + + direntry =3D array_get(&(s->directory), current_dir_index); + ret =3D vvfat_read(s->bs, cluster2sector(s, c), (uint8_t *)direntr= y, s->sectors_per_cluster); if (ret) return ret; @@ -2690,12 +2690,12 @@ static int handle_renames_and_mkdirs(BDRVVVFATState= * s) direntry_t* direntry =3D array_get(&(s->directory), mapping->info.dir.first_dir_index); uint32_t c =3D mapping->begin; - int i =3D 0; + int j =3D 0; =20 /* recurse */ while (!fat_eof(s, c)) { do { - direntry_t* d =3D direntry + i; + direntry_t *d =3D direntry + j; =20 if (is_file(d) || (is_directory(d) && !is_dot(d)))= { int l; @@ -2716,8 +2716,8 @@ static int handle_renames_and_mkdirs(BDRVVVFATState* = s) =20 schedule_rename(s, m->begin, new_path); } - i++; - } while((i % (0x10 * s->sectors_per_cluster)) !=3D 0); + j++; + } while (j % (0x10 * s->sectors_per_cluster) !=3D 0); c =3D fat_get(s, c); } } @@ -2804,16 +2804,16 @@ static int coroutine_fn GRAPH_RDLOCK handle_commits= (BDRVVVFATState* s) int begin =3D commit->param.new_file.first_cluster; mapping_t* mapping =3D find_mapping_for_cluster(s, begin); direntry_t* entry; - int i; + int j; =20 /* find direntry */ - for (i =3D 0; i < s->directory.next; i++) { - entry =3D array_get(&(s->directory), i); + for (j =3D 0; j < s->directory.next; j++) { + entry =3D array_get(&(s->directory), j); if (is_file(entry) && begin_of_direntry(entry) =3D=3D begi= n) break; } =20 - if (i >=3D s->directory.next) { + if (j >=3D s->directory.next) { fail =3D -6; continue; } @@ -2833,8 +2833,9 @@ static int coroutine_fn GRAPH_RDLOCK handle_commits(B= DRVVVFATState* s) mapping->mode =3D MODE_NORMAL; mapping->info.file.offset =3D 0; =20 - if (commit_one_file(s, i, 0)) + if (commit_one_file(s, j, 0)) { fail =3D -7; + } =20 break; } diff --git a/hw/block/xen-block.c b/hw/block/xen-block.c index 3906b9058b..a07cd7eb5d 100644 --- a/hw/block/xen-block.c +++ b/hw/block/xen-block.c @@ -369,7 +369,7 @@ static void xen_block_get_vdev(Object *obj, Visitor *v,= const char *name, case XEN_BLOCK_VDEV_TYPE_XVD: case XEN_BLOCK_VDEV_TYPE_HD: case XEN_BLOCK_VDEV_TYPE_SD: { - char *name =3D disk_to_vbd_name(vdev->disk); + char *vbd_name =3D disk_to_vbd_name(vdev->disk); =20 str =3D g_strdup_printf("%s%s%lu", (vdev->type =3D=3D XEN_BLOCK_VDEV_TYPE_XVD) ? @@ -377,8 +377,8 @@ static void xen_block_get_vdev(Object *obj, Visitor *v,= const char *name, (vdev->type =3D=3D XEN_BLOCK_VDEV_TYPE_HD) ? "hd" : "sd", - name, vdev->partition); - g_free(name); + vbd_name, vdev->partition); + g_free(vbd_name); break; } default: --=20 2.41.0 From nobody Fri May 17 11:29:14 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1695977696; cv=none; d=zohomail.com; s=zohoarc; b=jRnkxa4nfU0GH1Qt4CeVvLYs2XLNeZjQCWje4GqyUkjRzYsEOg14SDWAd2Mcs5L3e54iO8bMzH9kpjU2ZbpdTd9uyhBYioOu0TLvp7FcBu6LCPmLW8Aud5FCWcaAkPwTRlkGxsXKo71Dt+PNZab95smDpgmUdKdi4nDHYC5qiUg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695977696; 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=O4yJ2Frnw4Zv72Ec7RbFonUyum4A2WiWZfxuO+TZ6QM=; b=APQHfuTUtTj0JREDF6VAAtMJW3Z3zyZBz7O/d+qatw/Rm+oL29I1LA8Q9tUxV+y2O0INhDaL9rEQbVYke8eHIYHXb+noHrXCGPkEqpJqcvNGgkef+AZICvzl+QBVkcvemE6vFyk2mMcop7CFQMWM5k35wBRN7TZCKtH9mFkGjhQ= 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 1695977696385844.3446118038078; Fri, 29 Sep 2023 01:54:56 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qm9DU-00051U-Ga; Fri, 29 Sep 2023 04:51:20 -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 1qm9DH-0004wf-TW for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:08 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qm9D9-0005b2-3S for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:07 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-45-W7JTb9aQM8mXFbQjYqCMrg-1; Fri, 29 Sep 2023 04:50:55 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 99A938039C1; Fri, 29 Sep 2023 08:50:55 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5B9E02156702; Fri, 29 Sep 2023 08:50:55 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 63E7B21E6910; Fri, 29 Sep 2023 10:50:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695977458; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=O4yJ2Frnw4Zv72Ec7RbFonUyum4A2WiWZfxuO+TZ6QM=; b=WwgyffvHTOzZXfeuWKlDhNQBYJtWE+kaPGQdHwtJlenD8Uvw4ssZFiVGCrZ/YmgIr4aWEQ ln1MyhBXKBC2Oo2N8wnaboakKEhuQagN4xEkegnUcFt8oo4hehHbNt7fx6re0PEXK3QwL3 cUi0fhT7YHvT58R8U/LXwemS6RCiCbg= X-MC-Unique: W7JTb9aQM8mXFbQjYqCMrg-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, Eric Blake , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 07/56] qobject atomics osdep: Make a few macros more hygienic Date: Fri, 29 Sep 2023 10:50:04 +0200 Message-ID: <20230929085053.2789105-8-armbru@redhat.com> In-Reply-To: <20230929085053.2789105-1-armbru@redhat.com> References: <20230929085053.2789105-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 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=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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 @redhat.com) X-ZM-MESSAGEID: 1695977697330100003 Variables declared in macros can shadow other variables. Much of the time, this is harmless, e.g.: #define _FDT(exp) \ do { \ int ret =3D (exp); \ if (ret < 0) { \ error_report("error creating device tree: %s: %s", \ #exp, fdt_strerror(ret)); \ exit(1); \ } \ } while (0) Harmless shadowing in h_client_architecture_support(): target_ulong ret; [...] ret =3D do_client_architecture_support(cpu, spapr, vec, fdt_bufsize= ); if (ret =3D=3D H_SUCCESS) { _FDT((fdt_pack(spapr->fdt_blob))); [...] } return ret; However, we can get in trouble when the shadowed variable is used in a macro argument: #define QOBJECT(obj) ({ \ typeof(obj) o =3D (obj); \ o ? container_of(&(o)->base, QObject, base) : NULL; \ }) QOBJECT(o) expands into ({ Reviewed-by: Eric Blake Reviewed-by: Philippe Mathieu-Daud=C3=A9 ---> typeof(o) o =3D (o); o ? container_of(&(o)->base, QObject, base) : NULL; }) Unintended variable name capture at --->. We'd be saved by -Winit-self. But I could certainly construct more elaborate death traps that don't trigger it. To reduce the risk of trapping ourselves, we use variable names in macros that no sane person would use elsewhere. Here's our actual definition of QOBJECT(): #define QOBJECT(obj) ({ \ typeof(obj) _obj =3D (obj); \ _obj ? container_of(&(_obj)->base, QObject, base) : NULL; \ }) Works well enough until we nest macro calls. For instance, with #define qobject_ref(obj) ({ \ typeof(obj) _obj =3D (obj); \ qobject_ref_impl(QOBJECT(_obj)); \ _obj; \ }) the expression qobject_ref(obj) expands into ({ typeof(obj) _obj =3D (obj); qobject_ref_impl( ({ ---> typeof(_obj) _obj =3D (_obj); _obj ? container_of(&(_obj)->base, QObject, base) : NULL; })); _obj; }) Unintended variable name capture at --->. The only reliable way to prevent unintended variable name capture is -Wshadow. One blocker for enabling it is shadowing hiding in function-like macros like qdict_put(dict, "name", qobject_ref(...)) qdict_put() wraps its last argument in QOBJECT(), and the last argument here contains another QOBJECT(). Use dark preprocessor sorcery to make the macros that give us this problem use different variable names on every call. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Message-ID: <20230921121312.1301864-8-armbru@redhat.com> Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- include/qapi/qmp/qobject.h | 10 ++++++++-- include/qemu/atomic.h | 17 ++++++++++++----- include/qemu/compiler.h | 3 +++ include/qemu/osdep.h | 27 ++++++++++++++++++++------- 4 files changed, 43 insertions(+), 14 deletions(-) diff --git a/include/qapi/qmp/qobject.h b/include/qapi/qmp/qobject.h index 9003b71fd3..89b97d88bc 100644 --- a/include/qapi/qmp/qobject.h +++ b/include/qapi/qmp/qobject.h @@ -45,10 +45,16 @@ struct QObject { struct QObjectBase_ base; }; =20 -#define QOBJECT(obj) ({ \ +/* + * Preprocessor sorcery ahead: use a different identifier for the + * local variable in each expansion, so we can nest macro calls + * without shadowing variables. + */ +#define QOBJECT_INTERNAL(obj, _obj) ({ \ typeof(obj) _obj =3D (obj); \ - _obj ? container_of(&(_obj)->base, QObject, base) : NULL; \ + _obj ? container_of(&_obj->base, QObject, base) : NULL; \ }) +#define QOBJECT(obj) QOBJECT_INTERNAL((obj), MAKE_IDENTFIER(_obj)) =20 /* Required for qobject_to() */ #define QTYPE_CAST_TO_QNull QTYPE_QNULL diff --git a/include/qemu/atomic.h b/include/qemu/atomic.h index d95612f7a0..f1d3d1702a 100644 --- a/include/qemu/atomic.h +++ b/include/qemu/atomic.h @@ -157,13 +157,20 @@ smp_read_barrier_depends(); #endif =20 -#define qatomic_rcu_read(ptr) \ - ({ \ +/* + * Preprocessor sorcery ahead: use a different identifier for the + * local variable in each expansion, so we can nest macro calls + * without shadowing variables. + */ +#define qatomic_rcu_read_internal(ptr, _val) \ + ({ \ qemu_build_assert(sizeof(*ptr) <=3D ATOMIC_REG_SIZE); \ - typeof_strip_qual(*ptr) _val; \ - qatomic_rcu_read__nocheck(ptr, &_val); \ - _val; \ + typeof_strip_qual(*ptr) _val; \ + qatomic_rcu_read__nocheck(ptr, &_val); \ + _val; \ }) +#define qatomic_rcu_read(ptr) \ + qatomic_rcu_read_internal((ptr), MAKE_IDENTFIER(_val)) =20 #define qatomic_rcu_set(ptr, i) do { \ qemu_build_assert(sizeof(*ptr) <=3D ATOMIC_REG_SIZE); \ diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h index 7fda29b445..7f1bbbf05f 100644 --- a/include/qemu/compiler.h +++ b/include/qemu/compiler.h @@ -37,6 +37,9 @@ #define tostring(s) #s #endif =20 +/* Expands into an identifier stemN, where N is another number each time */ +#define MAKE_IDENTFIER(stem) glue(stem, __COUNTER__) + #ifndef likely #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index e4a4eb2d61..18b940db75 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -383,19 +383,28 @@ void QEMU_ERROR("code path is reachable") * determined by the pre-processor instead of the compiler, you'll * have to open-code it. Sadly, Coverity is severely confused by the * constant variants, so we have to dumb things down there. + * + * Preprocessor sorcery ahead: use different identifiers for the local + * variables in each expansion, so we can nest macro calls without + * shadowing variables. */ -#undef MIN -#define MIN(a, b) \ +#define MIN_INTERNAL(a, b, _a, _b) \ ({ \ typeof(1 ? (a) : (b)) _a =3D (a), _b =3D (b); \ _a < _b ? _a : _b; \ }) -#undef MAX -#define MAX(a, b) \ +#undef MIN +#define MIN(a, b) \ + MIN_INTERNAL((a), (b), MAKE_IDENTFIER(_a), MAKE_IDENTFIER(_b)) + +#define MAX_INTERNAL(a, b, _a, _b) \ ({ \ typeof(1 ? (a) : (b)) _a =3D (a), _b =3D (b); \ _a > _b ? _a : _b; \ }) +#undef MAX +#define MAX(a, b) \ + MAX_INTERNAL((a), (b), MAKE_IDENTFIER(_a), MAKE_IDENTFIER(_b)) =20 #ifdef __COVERITY__ # define MIN_CONST(a, b) ((a) < (b) ? (a) : (b)) @@ -416,14 +425,18 @@ void QEMU_ERROR("code path is reachable") /* * Minimum function that returns zero only if both values are zero. * Intended for use with unsigned values only. + * + * Preprocessor sorcery ahead: use different identifiers for the local + * variables in each expansion, so we can nest macro calls without + * shadowing variables. */ -#ifndef MIN_NON_ZERO -#define MIN_NON_ZERO(a, b) \ +#define MIN_NON_ZERO_INTERNAL(a, b, _a, _b) \ ({ \ typeof(1 ? (a) : (b)) _a =3D (a), _b =3D (b); \ _a =3D=3D 0 ? _b : (_b =3D=3D 0 || _b > _a) ? _a : _b; \ }) -#endif +#define MIN_NON_ZERO(a, b) \ + MIN_NON_ZERO_INTERNAL((a), (b), MAKE_IDENTFIER(_a), MAKE_IDENTFIER(_b)) =20 /* * Round number down to multiple. Safe when m is not a power of 2 (see --=20 2.41.0 From nobody Fri May 17 11:29:14 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1695977503; cv=none; d=zohomail.com; s=zohoarc; b=I766puQOnNGIKfEhvpQc0d/gkvOGzDRKagJQqYwHhIhKPT0KI0JqAErx8FlQJHsHadxOYIgVDQRkclQ5+8so3YPqulQTn8QKb8VHuVgOGbuz5sDJiaDei4NBc5tqy+vcOAYd/M/LTz1Qv/Xa71osVAEsAkE7v/oskftPUqYdJkM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695977503; 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=0BMIMSiB+DtFo+8Bx7+AdacnBshOWBPA/iIwhqoFIAc=; b=dKZCx3J8rGALd0kTKGINGBPYlrwokmZsOW28cy8aTWjqx+NXAGCOL8YhclA48J6SFtigKaUYv3TNkNmNxygMyLvlYROtQ5CIKfFduS+P43LEnAiYQ3D0x5rBBekZWMlfFvZNn9rglYqVX+YL+FMD7j6x3S7jNxUObpUlBJD7AWc= 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 1695977503091456.53606946989294; Fri, 29 Sep 2023 01:51:43 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qm9DQ-000504-GL; Fri, 29 Sep 2023 04:51: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 1qm9DF-0004w9-H3 for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:05 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qm9D9-0005b9-C8 for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:05 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-561-nGD1WDopN_29O-RGCB25-Q-1; Fri, 29 Sep 2023 04:50:55 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 81F3F8002B2; Fri, 29 Sep 2023 08:50:55 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5FE972156A27; Fri, 29 Sep 2023 08:50:55 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 66CD521E6911; Fri, 29 Sep 2023 10:50:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695977458; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0BMIMSiB+DtFo+8Bx7+AdacnBshOWBPA/iIwhqoFIAc=; b=Q0YF4oCglRbW80ty7Xd0bMsBYEkFgwpzCWM/gCCoH8lbn4kJSKAvSmAaSnagB4wcXChzYr X4tAEvwdDe4vat5Gy+NQxQ+agwVk8PnnScg7zAPYhalQCHkI681JmELckqHxF0k91dGexK fgfZ/Bk7nceAmXmGkfVnsmlKHCU6i0M= X-MC-Unique: nGD1WDopN_29O-RGCB25-Q-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PULL 08/56] tcg: Clean up local variable shadowing Date: Fri, 29 Sep 2023 10:50:05 +0200 Message-ID: <20230929085053.2789105-9-armbru@redhat.com> In-Reply-To: <20230929085053.2789105-1-armbru@redhat.com> References: <20230929085053.2789105-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 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=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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 @redhat.com) X-ZM-MESSAGEID: 1695977503673100001 From: Philippe Mathieu-Daud=C3=A9 Fix: tcg/tcg.c:2551:27: error: declaration shadows a local variable [-Werror,-= Wshadow] MemOp op =3D get_memop(oi); ^ tcg/tcg.c:2437:12: note: previous declaration is here TCGOp *op; ^ accel/tcg/tb-maint.c:245:18: error: declaration shadows a local variable = [-Werror,-Wshadow] for (int i =3D 0; i < V_L2_SIZE; i++) { ^ accel/tcg/tb-maint.c:210:9: note: previous declaration is here int i; ^ Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20230904161235.84651-2-philmd@linaro.org> Signed-off-by: Markus Armbruster --- accel/tcg/tb-maint.c | 3 +-- tcg/tcg.c | 16 ++++++++-------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/accel/tcg/tb-maint.c b/accel/tcg/tb-maint.c index 32ae8af61c..8c71cebabd 100644 --- a/accel/tcg/tb-maint.c +++ b/accel/tcg/tb-maint.c @@ -207,13 +207,12 @@ static PageDesc *page_find_alloc(tb_page_addr_t index= , bool alloc) { PageDesc *pd; void **lp; - int i; =20 /* Level 1. Always allocated. */ lp =3D l1_map + ((index >> v_l1_shift) & (v_l1_size - 1)); =20 /* Level 2..N-1. */ - for (i =3D v_l2_levels; i > 0; i--) { + for (int i =3D v_l2_levels; i > 0; i--) { void **p =3D qatomic_rcu_read(lp); =20 if (p =3D=3D NULL) { diff --git a/tcg/tcg.c b/tcg/tcg.c index 604fa9bf3e..ea94d0fbff 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -2549,21 +2549,21 @@ static void tcg_dump_ops(TCGContext *s, FILE *f, bo= ol have_prefs) { const char *s_al, *s_op, *s_at; MemOpIdx oi =3D op->args[k++]; - MemOp op =3D get_memop(oi); + MemOp mop =3D get_memop(oi); unsigned ix =3D get_mmuidx(oi); =20 - s_al =3D alignment_name[(op & MO_AMASK) >> MO_ASHIFT]; - s_op =3D ldst_name[op & (MO_BSWAP | MO_SSIZE)]; - s_at =3D atom_name[(op & MO_ATOM_MASK) >> MO_ATOM_SHIF= T]; - op &=3D ~(MO_AMASK | MO_BSWAP | MO_SSIZE | MO_ATOM_MAS= K); + s_al =3D alignment_name[(mop & MO_AMASK) >> MO_ASHIFT]; + s_op =3D ldst_name[mop & (MO_BSWAP | MO_SSIZE)]; + s_at =3D atom_name[(mop & MO_ATOM_MASK) >> MO_ATOM_SHI= FT]; + mop &=3D ~(MO_AMASK | MO_BSWAP | MO_SSIZE | MO_ATOM_MA= SK); =20 /* If all fields are accounted for, print symbolically= . */ - if (!op && s_al && s_op && s_at) { + if (!mop && s_al && s_op && s_at) { col +=3D ne_fprintf(f, ",%s%s%s,%u", s_at, s_al, s_op, ix); } else { - op =3D get_memop(oi); - col +=3D ne_fprintf(f, ",$0x%x,%u", op, ix); + mop =3D get_memop(oi); + col +=3D ne_fprintf(f, ",$0x%x,%u", mop, ix); } i =3D 1; } --=20 2.41.0 From nobody Fri May 17 11:29:14 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1695977625; cv=none; d=zohomail.com; s=zohoarc; b=LJSJuW3iQJ+ncakuS6W9Pwg/HjxC6S3VPRwKLcjF5pHz91XynLDp81tnWYSYPkId8XZ116xKAhbvNQkqbY4Va8CNujHLDCutl+aleSvM/pg/DfzeRZYAKXP8FMjkYAAyeH4+5WkxnceHjW/rcrb3S94p0MI3Cscftf2uQ5ErKCI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695977625; 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=AMZbLYPBV1xCTpn0hbevuva2cgsCsR3rt8ss4bjxa7M=; b=LGsTjEUu+juPUJKcJUXs09qE75igyWtar3jCkb5kYUXwpz/c0LBf477pOZT53eiZJRYeiuTC3c03rCwCH8pz7Mf76g/xaweM236oE6rXn5yLY0E1bvCJpzyaLK2dwiOZfsD3iVFUJGUPvNgBNW0mh6FCDY0qQJwpjNwHO4G3hf8= 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 1695977625210422.67831248739935; Fri, 29 Sep 2023 01:53:45 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qm9DY-00056m-Al; Fri, 29 Sep 2023 04:51:24 -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 1qm9DK-0004xN-SY for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:11 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qm9DA-0005bh-L2 for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:10 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-270-L5gqqdaWP2WDBbIr-vM03w-1; Fri, 29 Sep 2023 04:50:56 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A48F6185A790; Fri, 29 Sep 2023 08:50:55 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6613740C6EC0; Fri, 29 Sep 2023 08:50:55 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 69AF821E6912; Fri, 29 Sep 2023 10:50:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695977459; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AMZbLYPBV1xCTpn0hbevuva2cgsCsR3rt8ss4bjxa7M=; b=itqpEFpBbo0HPfBSgEdd7V7MplauhHztKSHAwcF8AeCFMLciC49u4NMuGIe8HUrIkKv7DN wx+rookXta3ONZOlqwdGfdx+MncGUbM6OpXNlyvPTXbXE5YYrPh6XMJGuDe74NsoBT/KnL Aaz1+pVHjVnqNGd+mb+mjya9xsAsgUY= X-MC-Unique: L5gqqdaWP2WDBbIr-vM03w-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Peter Maydell Subject: [PULL 09/56] target/arm/tcg: Clean up local variable shadowing Date: Fri, 29 Sep 2023 10:50:06 +0200 Message-ID: <20230929085053.2789105-10-armbru@redhat.com> In-Reply-To: <20230929085053.2789105-1-armbru@redhat.com> References: <20230929085053.2789105-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 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=170.10.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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 @redhat.com) X-ZM-MESSAGEID: 1695977626044100003 From: Philippe Mathieu-Daud=C3=A9 Fix: target/arm/tcg/translate-m-nocp.c: In function =E2=80=98gen_M_fp_sysreg_r= ead=E2=80=99: target/arm/tcg/translate-m-nocp.c:509:18: warning: declaration of =E2=80= =98tmp=E2=80=99 shadows a previous local [-Wshadow=3Dcompatible-local] 509 | TCGv_i32 tmp =3D load_cpu_field(v7m.fpdscr[M_REG_NS]); | ^~~ target/arm/tcg/translate-m-nocp.c:433:14: note: shadowed declaration is h= ere 433 | TCGv_i32 tmp; | ^~~ --- target/arm/tcg/mve_helper.c: In function =E2=80=98helper_mve_vqshlsb=E2= =80=99: target/arm/tcg/mve_helper.c:1259:19: warning: declaration of =E2=80=98r= =E2=80=99 shadows a previous local [-Wshadow=3Dcompatible-local] 1259 | typeof(N) r =3D FN(N, (int8_t)(M), sizeof(N) * 8, ROUND, = &su32); \ | ^ target/arm/tcg/mve_helper.c:1267:5: note: in expansion of macro =E2=80=98= WRAP_QRSHL_HELPER=E2=80=99 1267 | WRAP_QRSHL_HELPER(do_sqrshl_bhs, N, M, false, satp) | ^~~~~~~~~~~~~~~~~ target/arm/tcg/mve_helper.c:927:22: note: in expansion of macro =E2=80=98= DO_SQSHL_OP=E2=80=99 927 | TYPE r =3D FN(n[H##ESIZE(e)], m[H##ESIZE(e)], &sat); = \ | ^~ target/arm/tcg/mve_helper.c:945:5: note: in expansion of macro =E2=80=98D= O_2OP_SAT=E2=80=99 945 | DO_2OP_SAT(OP##b, 1, int8_t, FN) \ | ^~~~~~~~~~ target/arm/tcg/mve_helper.c:1277:1: note: in expansion of macro =E2=80=98= DO_2OP_SAT_S=E2=80=99 1277 | DO_2OP_SAT_S(vqshls, DO_SQSHL_OP) | ^~~~~~~~~~~~ --- target/arm/tcg/mve_helper.c: In function =E2=80=98do_sqrshl48_d=E2=80=99: target/arm/tcg/mve_helper.c:2463:17: warning: declaration of =E2=80=98ext= val=E2=80=99 shadows a previous local [-Wshadow=3Dcompatible-local] 2463 | int64_t extval =3D sextract64(src << shift, 0, 48); | ^~~~~~ target/arm/tcg/mve_helper.c:2443:18: note: shadowed declaration is here 2443 | int64_t val, extval; | ^~~~~~ --- target/arm/tcg/mve_helper.c: In function =E2=80=98do_uqrshl48_d=E2=80=99: target/arm/tcg/mve_helper.c:2495:18: warning: declaration of =E2=80=98ext= val=E2=80=99 shadows a previous local [-Wshadow=3Dcompatible-local] 2495 | uint64_t extval =3D extract64(src << shift, 0, 48); | ^~~~~~ target/arm/tcg/mve_helper.c:2479:19: note: shadowed declaration is here 2479 | uint64_t val, extval; | ^~~~~~ Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20230904161235.84651-3-philmd@linaro.org> Reviewed-by: Peter Maydell Signed-off-by: Markus Armbruster --- target/arm/tcg/mve_helper.c | 16 ++++++++-------- target/arm/tcg/translate-m-nocp.c | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/target/arm/tcg/mve_helper.c b/target/arm/tcg/mve_helper.c index c666a96ba1..8b99736aad 100644 --- a/target/arm/tcg/mve_helper.c +++ b/target/arm/tcg/mve_helper.c @@ -925,8 +925,8 @@ DO_1OP_IMM(vorri, DO_ORRI) bool qc =3D false; \ for (e =3D 0; e < 16 / ESIZE; e++, mask >>=3D ESIZE) { = \ bool sat =3D false; \ - TYPE r =3D FN(n[H##ESIZE(e)], m[H##ESIZE(e)], &sat); \ - mergemask(&d[H##ESIZE(e)], r, mask); \ + TYPE r_ =3D FN(n[H##ESIZE(e)], m[H##ESIZE(e)], &sat); \ + mergemask(&d[H##ESIZE(e)], r_, mask); \ qc |=3D sat & mask & 1; \ } \ if (qc) { \ @@ -1250,11 +1250,11 @@ DO_2OP_SAT(vqsubsw, 4, int32_t, DO_SQSUB_W) #define WRAP_QRSHL_HELPER(FN, N, M, ROUND, satp) \ ({ \ uint32_t su32 =3D 0; \ - typeof(N) r =3D FN(N, (int8_t)(M), sizeof(N) * 8, ROUND, &su32); \ + typeof(N) qrshl_ret =3D FN(N, (int8_t)(M), sizeof(N) * 8, ROUND, &= su32); \ if (su32) { \ *satp =3D true; \ } \ - r; \ + qrshl_ret; \ }) =20 #define DO_SQSHL_OP(N, M, satp) \ @@ -1292,12 +1292,12 @@ DO_2OP_SAT_U(vqrshlu, DO_UQRSHL_OP) for (e =3D 0; e < 16 / ESIZE; e++, mask >>=3D ESIZE) { = \ bool sat =3D false; \ if ((e & 1) =3D=3D XCHG) { = \ - TYPE r =3D FN(n[H##ESIZE(e)], \ + TYPE vqdmladh_ret =3D FN(n[H##ESIZE(e)], \ m[H##ESIZE(e - XCHG)], \ n[H##ESIZE(e + (1 - 2 * XCHG))], \ m[H##ESIZE(e + (1 - XCHG))], \ ROUND, &sat); \ - mergemask(&d[H##ESIZE(e)], r, mask); \ + mergemask(&d[H##ESIZE(e)], vqdmladh_ret, mask); \ qc |=3D sat & mask & 1; \ } \ } \ @@ -2454,7 +2454,7 @@ static inline int64_t do_sqrshl48_d(int64_t src, int6= 4_t shift, return extval; } } else if (shift < 48) { - int64_t extval =3D sextract64(src << shift, 0, 48); + extval =3D sextract64(src << shift, 0, 48); if (!sat || src =3D=3D (extval >> shift)) { return extval; } @@ -2486,7 +2486,7 @@ static inline uint64_t do_uqrshl48_d(uint64_t src, in= t64_t shift, return extval; } } else if (shift < 48) { - uint64_t extval =3D extract64(src << shift, 0, 48); + extval =3D extract64(src << shift, 0, 48); if (!sat || src =3D=3D (extval >> shift)) { return extval; } diff --git a/target/arm/tcg/translate-m-nocp.c b/target/arm/tcg/translate-m= -nocp.c index 33f6478bb9..42308c4db5 100644 --- a/target/arm/tcg/translate-m-nocp.c +++ b/target/arm/tcg/translate-m-nocp.c @@ -506,7 +506,7 @@ static bool gen_M_fp_sysreg_read(DisasContext *s, int r= egno, =20 gen_branch_fpInactive(s, TCG_COND_EQ, lab_active); /* fpInactive case: reads as FPDSCR_NS */ - TCGv_i32 tmp =3D load_cpu_field(v7m.fpdscr[M_REG_NS]); + tmp =3D load_cpu_field(v7m.fpdscr[M_REG_NS]); storefn(s, opaque, tmp, true); lab_end =3D gen_new_label(); tcg_gen_br(lab_end); --=20 2.41.0 From nobody Fri May 17 11:29:14 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1695977528; cv=none; d=zohomail.com; s=zohoarc; b=FpxYEhS5GM45XqkgAfqeceCM+NM4/MeGzaB7j3ZqDRF6wVNf41Fqp29zUJmk1H0Cf+0S9PK2jKtLNLPHoWpHhRZB3jBOHyMw9JIiCN/Niw9kGFjTiUVcKsZpZ36Y2Dwaa3m4iF+tHKxuAY21ERQik75PbeyRIPCmtt97/2CQlwQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695977528; 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=mNNZqgGBCRydSpAMm3CyVCUzTpS3bjgDJpddGBx98jU=; b=NVIJSEdB00zyF1q62ZXb4hmKzZ2POw4H7fOE5yYzal/jYTmN7W1inv5bzwKEH8k/1OCfAXIBwuioImf4mL8BbpoH9OJ22fkYhm1OyhpmIhR78izTxNZ/Xb/ZqHGgVTmRKCIQU0Z2DIsVfujZy3cJtuSHQFDFq8Uu4NvFkyWnies= 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 1695977528488881.0950528126853; Fri, 29 Sep 2023 01:52:08 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qm9Dk-0005Im-Pw; Fri, 29 Sep 2023 04:51:36 -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 1qm9Da-00059a-3G for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:26 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qm9DD-0005e9-5B for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:25 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-687-lCh5EhyPOK65QNQSC-WqAw-1; Fri, 29 Sep 2023 04:50:55 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8FCE385A5A8; Fri, 29 Sep 2023 08:50:55 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6B9D910005D2; Fri, 29 Sep 2023 08:50:55 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 6C83021E6913; Fri, 29 Sep 2023 10:50:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695977462; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mNNZqgGBCRydSpAMm3CyVCUzTpS3bjgDJpddGBx98jU=; b=B2Sy3zHywSbkwhrRNbXXzkh8TTaEz5iJbyXuwhdWZsYtN2FPPGgkEbOxFYzn1dcdWTPzmi C9DFw9Zr2/KCFEDE4Sz+d4q9zmOPpdvnM3Qz1pkNvKLc16vUwm6Wmr6JO+4uuKIxwu6E1b lljPkU/pYskcaV+U+ymAP0jJI0P47hg= X-MC-Unique: lCh5EhyPOK65QNQSC-WqAw-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Peter Maydell Subject: [PULL 10/56] target/arm/hvf: Clean up local variable shadowing Date: Fri, 29 Sep 2023 10:50:07 +0200 Message-ID: <20230929085053.2789105-11-armbru@redhat.com> In-Reply-To: <20230929085053.2789105-1-armbru@redhat.com> References: <20230929085053.2789105-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 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=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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 @redhat.com) X-ZM-MESSAGEID: 1695977529898100002 From: Philippe Mathieu-Daud=C3=A9 Per Peter Maydell analysis [*]: The hvf_vcpu_exec() function is not documented, but in practice its caller expects it to return either EXCP_DEBUG (for "this was a guest debug exception you need to deal with") or something else (presumably the intention being 0 for OK). The hvf_sysreg_read() and hvf_sysreg_write() functions are also not documented, but they return 0 on success, or 1 for a completely unrecognized sysreg where we've raised the UNDEF exception (but not if we raised an UNDEF exception for an unrecognized GIC sysreg -- I think this is a bug). We use this return value to decide whether we need to advance the PC past the insn or not. It's not the same as the return value we want to return from hvf_vcpu_exec(). Retain the variable as locally scoped but give it a name that doesn't clash with the other function-scoped variable. This fixes: target/arm/hvf/hvf.c:1936:13: error: declaration shadows a local variable= [-Werror,-Wshadow] int ret =3D 0; ^ target/arm/hvf/hvf.c:1807:9: note: previous declaration is here int ret; ^ [*] https://lore.kernel.org/qemu-devel/CAFEAcA_e+fU6JKtS+W63wr9cCJ6btu_hT_y= dZWOwC0kBkDYYYQ@mail.gmail.com/ Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20230904161235.84651-4-philmd@linaro.org> Reviewed-by: Peter Maydell Signed-off-by: Markus Armbruster --- target/arm/hvf/hvf.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/target/arm/hvf/hvf.c b/target/arm/hvf/hvf.c index 546c0e817f..757e13b0f9 100644 --- a/target/arm/hvf/hvf.c +++ b/target/arm/hvf/hvf.c @@ -1934,16 +1934,16 @@ int hvf_vcpu_exec(CPUState *cpu) uint32_t rt =3D (syndrome >> 5) & 0x1f; uint32_t reg =3D syndrome & SYSREG_MASK; uint64_t val; - int ret =3D 0; + int sysreg_ret =3D 0; =20 if (isread) { - ret =3D hvf_sysreg_read(cpu, reg, rt); + sysreg_ret =3D hvf_sysreg_read(cpu, reg, rt); } else { val =3D hvf_get_reg(cpu, rt); - ret =3D hvf_sysreg_write(cpu, reg, val); + sysreg_ret =3D hvf_sysreg_write(cpu, reg, val); } =20 - advance_pc =3D !ret; + advance_pc =3D !sysreg_ret; break; } case EC_WFX_TRAP: --=20 2.41.0 From nobody Fri May 17 11:29:14 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1695977935; cv=none; d=zohomail.com; s=zohoarc; b=TSuI0rsSx6oh96I+lMgJhlyJ3KtGkPJbOcDW/D6R+TsIhZAEgqe7GyL5TFUOYs2iy9LtZ3I3ubsa7PfwHKrskuGbJQIQurb095enNKBN2ykDi1fNmTOF1j7sAVgrd1yXSe2COkGjwpkSdKKnnoq+2Q4ifVO7fhk9XcBXGLAx9ac= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695977935; 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=Fo3sgQUoq1v/rXQDfdnS796xPwOPol/7CVX97Dogeq8=; b=MwGiEf86cMg2Ur/X62OHBNaTkv46Cp31/M0I0wRXQ7EiYi3S55G6FxPSiLaKc9K+D6BjE7fGXSTFwxZDwa/DoaIF/xal8ZopnA1wpNyn61vH0CDbd021mSdCzMP9dIqCAr8Qib9j992DjYBT/Nw51Lwl3fR0WWdIPjWK6kAmGKk= 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 1695977935557415.62894245121197; Fri, 29 Sep 2023 01:58:55 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qm9Dg-0005Ca-84; Fri, 29 Sep 2023 04:51:32 -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 1qm9DU-00051z-M4 for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:21 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qm9DA-0005bz-QJ for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:20 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-687-trWVRLUMOdCuyehyScSo0A-1; Fri, 29 Sep 2023 04:50:56 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id ABEC3811E7E; Fri, 29 Sep 2023 08:50:55 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6DDF810F1BE7; Fri, 29 Sep 2023 08:50:55 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 6F4FD21E6914; Fri, 29 Sep 2023 10:50:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695977460; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Fo3sgQUoq1v/rXQDfdnS796xPwOPol/7CVX97Dogeq8=; b=TibOjdtLQUTBIiTTXeUOv4sI7jAwuvLNUuJlCg2byizpKYo5fBWwUGTfGDpA0dDzKszwDR p0dCh3YQ6wJWwTQa4+1CcJ7EBtauvYs1iLsBXyIq9l3BldqY2PXqkbdpbiJ/dej7Mfly78 xonO0MGdbuEvWIuOsGkP+JlCGjG3zr8= X-MC-Unique: trWVRLUMOdCuyehyScSo0A-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 11/56] target/mips: Clean up local variable shadowing Date: Fri, 29 Sep 2023 10:50:08 +0200 Message-ID: <20230929085053.2789105-12-armbru@redhat.com> In-Reply-To: <20230929085053.2789105-1-armbru@redhat.com> References: <20230929085053.2789105-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 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=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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 @redhat.com) X-ZM-MESSAGEID: 1695977935951100001 From: Philippe Mathieu-Daud=C3=A9 Fix: target/mips/tcg/nanomips_translate.c.inc:4410:33: error: declaration shad= ows a local variable [-Werror,-Wshadow] int32_t imm =3D extract32(ctx->opcode, 1, 13) | ^ target/mips/tcg/nanomips_translate.c.inc:3577:9: note: previous declarati= on is here int imm; ^ target/mips/tcg/translate.c:15578:19: error: declaration shadows a local = variable [-Werror,-Wshadow] for (unsigned i =3D 1; i < 32; i++) { ^ target/mips/tcg/translate.c:15567:9: note: previous declaration is here int i; ^ target/mips/tcg/msa_helper.c:7478:13: error: declaration shadows a local = variable [-Werror,-Wshadow] MSA_FLOAT_MAXOP(pwx->w[0], min, pws->w[0], pws->w[0], 32); ^ target/mips/tcg/msa_helper.c:7434:23: note: expanded from macro 'MSA_FLOA= T_MAXOP' float_status *status =3D &env->active_tc.msa_fp_status; ^ Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20230904161235.84651-5-philmd@linaro.org> Signed-off-by: Markus Armbruster --- target/mips/tcg/msa_helper.c | 8 ++++---- target/mips/tcg/translate.c | 8 +++----- target/mips/tcg/nanomips_translate.c.inc | 6 +++--- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/target/mips/tcg/msa_helper.c b/target/mips/tcg/msa_helper.c index c314a74397..7a8dbada5d 100644 --- a/target/mips/tcg/msa_helper.c +++ b/target/mips/tcg/msa_helper.c @@ -7432,15 +7432,15 @@ void helper_msa_ftq_df(CPUMIPSState *env, uint32_t = df, uint32_t wd, =20 #define MSA_FLOAT_MAXOP(DEST, OP, ARG1, ARG2, BITS) = \ do { = \ - float_status *status =3D &env->active_tc.msa_fp_status; = \ + float_status *status_ =3D &env->active_tc.msa_fp_status; = \ int c; = \ = \ - set_float_exception_flags(0, status); = \ - DEST =3D float ## BITS ## _ ## OP(ARG1, ARG2, status); = \ + set_float_exception_flags(0, status_); = \ + DEST =3D float ## BITS ## _ ## OP(ARG1, ARG2, status_); = \ c =3D update_msacsr(env, 0, 0); = \ = \ if (get_enabled_exceptions(env, c)) { = \ - DEST =3D ((FLOAT_SNAN ## BITS(status) >> 6) << 6) | c; = \ + DEST =3D ((FLOAT_SNAN ## BITS(status_) >> 6) << 6) | c; = \ } = \ } while (0) =20 diff --git a/target/mips/tcg/translate.c b/target/mips/tcg/translate.c index 9bb40f1849..26d741d960 100644 --- a/target/mips/tcg/translate.c +++ b/target/mips/tcg/translate.c @@ -15564,10 +15564,8 @@ void gen_intermediate_code(CPUState *cs, Translati= onBlock *tb, int *max_insns, =20 void mips_tcg_init(void) { - int i; - cpu_gpr[0] =3D NULL; - for (i =3D 1; i < 32; i++) + for (unsigned i =3D 1; i < 32; i++) cpu_gpr[i] =3D tcg_global_mem_new(cpu_env, offsetof(CPUMIPSState, active_tc.gpr[i]), @@ -15584,7 +15582,7 @@ void mips_tcg_init(void) rname); } #endif /* !TARGET_MIPS64 */ - for (i =3D 0; i < 32; i++) { + for (unsigned i =3D 0; i < 32; i++) { int off =3D offsetof(CPUMIPSState, active_fpu.fpr[i].wr.d[0]); =20 fpu_f64[i] =3D tcg_global_mem_new_i64(cpu_env, off, fregnames[i]); @@ -15592,7 +15590,7 @@ void mips_tcg_init(void) msa_translate_init(); cpu_PC =3D tcg_global_mem_new(cpu_env, offsetof(CPUMIPSState, active_tc.PC), "PC"= ); - for (i =3D 0; i < MIPS_DSP_ACC; i++) { + for (unsigned i =3D 0; i < MIPS_DSP_ACC; i++) { cpu_HI[i] =3D tcg_global_mem_new(cpu_env, offsetof(CPUMIPSState, active_tc.HI= [i]), regnames_HI[i]); diff --git a/target/mips/tcg/nanomips_translate.c.inc b/target/mips/tcg/nan= omips_translate.c.inc index a98dde0d2e..d81a7c2d11 100644 --- a/target/mips/tcg/nanomips_translate.c.inc +++ b/target/mips/tcg/nanomips_translate.c.inc @@ -4407,8 +4407,8 @@ static int decode_nanomips_32_48_opc(CPUMIPSState *en= v, DisasContext *ctx) case NM_BPOSGE32C: check_dsp_r3(ctx); { - int32_t imm =3D extract32(ctx->opcode, 1, 13) | - extract32(ctx->opcode, 0, 1) << 13; + imm =3D extract32(ctx->opcode, 1, 13) + | extract32(ctx->opcode, 0, 1) << 13; =20 gen_compute_branch_nm(ctx, OPC_BPOSGE32, 4, -1, -2, imm << 1); @@ -4635,7 +4635,7 @@ static int decode_isa_nanomips(CPUMIPSState *env, Dis= asContext *ctx) break; case NM_LI16: { - int imm =3D extract32(ctx->opcode, 0, 7); + imm =3D extract32(ctx->opcode, 0, 7); imm =3D (imm =3D=3D 0x7f ? -1 : imm); if (rt !=3D 0) { tcg_gen_movi_tl(cpu_gpr[rt], imm); --=20 2.41.0 From nobody Fri May 17 11:29:14 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1695977530; cv=none; d=zohomail.com; s=zohoarc; b=aekqNT1t61wmIRMPsxAW6roq6ET6IA1oPtA5ZWE0BIa+/ypbgmybRP0aTp1M/gWd3V6Fwpi/2iNeHaIKfhEIlxnXc+yi2IoGYI/Qfjqgy4ozJmG7wkSkFqF//OdxIjDNZQ2Y1bkKWyCbBTUsWbuKkBfot2gzLdkQLU7UToyl0jc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695977530; 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=Ll5bXXu1nVFA0cbGY/6KvJ6V2dFJkq3aCHLqLxUxRGI=; b=FymcjXHFjT7ULRIspxD3MX8zI+lj3aYcymiyCPKhSkyjZ+b82qRk69+LtanumAuTvvSH/Y183Ly/D15WUnnxch3b1K2m28qB4GjrphmFxFLJ0n1YGFqmob48tQIVhNnvyipxljKDgDO+rJNz9g7ph6/vhViOYB+gQ1PVleMW9aQ= 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 1695977530824564.5731970726134; Fri, 29 Sep 2023 01:52:10 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qm9DZ-000596-M7; Fri, 29 Sep 2023 04:51:25 -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 1qm9DV-000520-Ai for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:21 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qm9DB-0005cs-Tj for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:21 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-528-xP6j9z8_NI2t_HgIbxbisA-1; Fri, 29 Sep 2023 04:50:56 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A091B101A53B; Fri, 29 Sep 2023 08:50:55 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7D7D714171CA; Fri, 29 Sep 2023 08:50:55 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 7230B21E6915; Fri, 29 Sep 2023 10:50:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695977461; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Ll5bXXu1nVFA0cbGY/6KvJ6V2dFJkq3aCHLqLxUxRGI=; b=fYGIgKtnYHEblAqXOdvKkuccq9FBVMXAiFnYUi0rm2uFoWlaiXmGxbEWTMX/WOJ5Niz7Nq ebMObLIeFlY63YM17ajkC9XU8SfowstDYMqng5SwgA8cduRq5z7kGrTgl1sL0cSveGUVr6 r5TogwRLJvvqpkuIHEJ6FQuZXToWZ+E= X-MC-Unique: xP6j9z8_NI2t_HgIbxbisA-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Peter Maydell Subject: [PULL 12/56] target/m68k: Clean up local variable shadowing Date: Fri, 29 Sep 2023 10:50:09 +0200 Message-ID: <20230929085053.2789105-13-armbru@redhat.com> In-Reply-To: <20230929085053.2789105-1-armbru@redhat.com> References: <20230929085053.2789105-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 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=170.10.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.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, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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 @redhat.com) X-ZM-MESSAGEID: 1695977531959100001 From: Philippe Mathieu-Daud=C3=A9 Fix: target/m68k/translate.c:828:18: error: declaration shadows a local variab= le [-Werror,-Wshadow] TCGv tmp =3D tcg_temp_new(); ^ target/m68k/translate.c:801:15: note: previous declaration is here TCGv reg, tmp, result; ^ Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Peter Maydell Message-ID: <20230904161235.84651-6-philmd@linaro.org> Signed-off-by: Markus Armbruster --- target/m68k/translate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/m68k/translate.c b/target/m68k/translate.c index 9e224fe796..15c9ddf427 100644 --- a/target/m68k/translate.c +++ b/target/m68k/translate.c @@ -824,7 +824,7 @@ static TCGv gen_ea_mode(CPUM68KState *env, DisasContext= *s, int mode, int reg0, reg =3D get_areg(s, reg0); result =3D gen_ldst(s, opsize, reg, val, what, index); if (what =3D=3D EA_STORE || !addrp) { - TCGv tmp =3D tcg_temp_new(); + tmp =3D tcg_temp_new(); if (reg0 =3D=3D 7 && opsize =3D=3D OS_BYTE && m68k_feature(s->env, M68K_FEATURE_M68K)) { tcg_gen_addi_i32(tmp, reg, 2); --=20 2.41.0 From nobody Fri May 17 11:29:14 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1695977777; cv=none; d=zohomail.com; s=zohoarc; b=Q78pJFFu90nWA0A965UxtosD9BOVfbayqll0HCQkAT9ehf/92mPHrqI4fR9BG0fdznVGGPw5u9Nmoy1kzw7fgvxh1IxphuS80KfmB4aXq7fmYo4liuI/zFfJKQeTwqlqgtb29sAkocJ8dq3+er80MSEu5BsGNTdQUU4mAqDJiLI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695977777; 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=u+gXFHyiOssKuws26aj3snZMvL7ARvGkD3IT5khP5Gs=; b=PiHx6KtwJ8vMsSnrUZjIr/+M+t7NiNnjMaQkcehc75amaKtV2RYdMHLpGhmLCocWgRmQaUpiz0wqLLkEs041LyA1f9dYZ/nf3dx+UwTTqgfwS3uYVBjNxq4kuY2JotiNMXabp4mAKlZPv3TC2uveuIVn1mNfepm8hP8SYLpCV6U= 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 1695977777643529.7561527401477; Fri, 29 Sep 2023 01:56:17 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qm9Dc-0005C2-QK; Fri, 29 Sep 2023 04:51:30 -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 1qm9DQ-000507-Ng for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:17 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qm9DA-0005bl-LT for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:16 -0400 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-687-6k7aB4tCOci4Zb3cCu60Lw-1; Fri, 29 Sep 2023 04:50:56 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id ED0F03806737; Fri, 29 Sep 2023 08:50:55 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B1AE0C15BB8; Fri, 29 Sep 2023 08:50:55 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 7512621E6916; Fri, 29 Sep 2023 10:50:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695977459; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=u+gXFHyiOssKuws26aj3snZMvL7ARvGkD3IT5khP5Gs=; b=IRmI0hMbijL9PGvPcLbqExV4cHXf0wofA0Frn+Yhh6PBq0U3Rsgrz00pFwRJly/OwXEvh7 Uqz4wSt3KlFVzTq7aV5LfYzfR2H+hLOTI3bAxf0XklCKGNsXyv3ry+o20pfH3P0CmWrXOM CDAHnh/8wPw4Ie8P8Mtj3rrMVzkYIdE= X-MC-Unique: 6k7aB4tCOci4Zb3cCu60Lw-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Bastian Koppelmann Subject: [PULL 13/56] target/tricore: Clean up local variable shadowing Date: Fri, 29 Sep 2023 10:50:10 +0200 Message-ID: <20230929085053.2789105-14-armbru@redhat.com> In-Reply-To: <20230929085053.2789105-1-armbru@redhat.com> References: <20230929085053.2789105-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 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=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, 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 @redhat.com) X-ZM-MESSAGEID: 1695977778458100003 From: Philippe Mathieu-Daud=C3=A9 Fix: target/tricore/translate.c:5016:18: warning: declaration of =E2=80=98temp= =E2=80=99 shadows a previous local [-Wshadow=3Dcompatible-local] 5016 | TCGv temp =3D tcg_constant_i32(const9); | ^~~~ target/tricore/translate.c:4958:10: note: shadowed declaration is here 4958 | TCGv temp; | ^~~~ Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20230904161235.84651-7-philmd@linaro.org> Reviewed-by: Bastian Koppelmann Signed-off-by: Markus Armbruster --- target/tricore/translate.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/target/tricore/translate.c b/target/tricore/translate.c index 6ae5ccbf72..9ca211b2a8 100644 --- a/target/tricore/translate.c +++ b/target/tricore/translate.c @@ -4962,8 +4962,6 @@ static void decode_rc_logical_shift(DisasContext *ctx) const9 =3D MASK_OP_RC_CONST9(ctx->opcode); op2 =3D MASK_OP_RC_OP2(ctx->opcode); =20 - temp =3D tcg_temp_new(); - switch (op2) { case OPC2_32_RC_AND: tcg_gen_andi_tl(cpu_gpr_d[r2], cpu_gpr_d[r1], const9); @@ -4972,10 +4970,12 @@ static void decode_rc_logical_shift(DisasContext *c= tx) tcg_gen_andi_tl(cpu_gpr_d[r2], cpu_gpr_d[r1], ~const9); break; case OPC2_32_RC_NAND: + temp =3D tcg_temp_new(); tcg_gen_movi_tl(temp, const9); tcg_gen_nand_tl(cpu_gpr_d[r2], cpu_gpr_d[r1], temp); break; case OPC2_32_RC_NOR: + temp =3D tcg_temp_new(); tcg_gen_movi_tl(temp, const9); tcg_gen_nor_tl(cpu_gpr_d[r2], cpu_gpr_d[r1], temp); break; @@ -5013,7 +5013,7 @@ static void decode_rc_logical_shift(DisasContext *ctx) break; case OPC2_32_RC_SHUFFLE: if (has_feature(ctx, TRICORE_FEATURE_162)) { - TCGv temp =3D tcg_constant_i32(const9); + temp =3D tcg_constant_i32(const9); gen_helper_shuffle(cpu_gpr_d[r2], cpu_gpr_d[r1], temp); } else { generate_trap(ctx, TRAPC_INSN_ERR, TIN2_IOPC); --=20 2.41.0 From nobody Fri May 17 11:29:14 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1695977863; cv=none; d=zohomail.com; s=zohoarc; b=Y59cW3F3dHI2VYZpFPk9ls0hTSjtNZv5f8ZIIwAAg9ULffoh0OeO4Lv2Nwk1UKWPj05GrZ/1rcaeLmT4ozxouVtfiyZjUyVaNXqcEYhJITMmH7M/sYhOqHsSed38NDmboIjVcLxQcmbM6sQCFMa3inHntlopPHhpVDpNYo9Z9fw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695977863; 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=EcNL3KNWfgGlXj+8QerAso4JKo/jrGmH/Zj7oToKoSI=; b=m7sy5q60IRD45V5Y/E7iB3X2qTDY7J3B8U7dQorFip+g33a6n4pNOV4GGGx+y62s327GGa7EqaZKAXZ+PArsgv63odmnE2zJ8u6LHwEOI1nSftx4csm1ISnmwrtWk798eQUR8BynBbwBZAjiuGv6Pm41T2AQpOoTIYi8QHL0oec= 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 1695977863902973.3014126982304; Fri, 29 Sep 2023 01:57:43 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qm9DX-00055f-Em; Fri, 29 Sep 2023 04:51:23 -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 1qm9DM-0004y1-Jg for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:12 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qm9DB-0005c4-E0 for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:12 -0400 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-115--IoKKtiEMlyUhlgi78Svhw-1; Fri, 29 Sep 2023 04:50:56 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id F258C3C0F458; Fri, 29 Sep 2023 08:50:55 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B469B176E4; Fri, 29 Sep 2023 08:50:55 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 77EFA21E691A; Fri, 29 Sep 2023 10:50:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695977460; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EcNL3KNWfgGlXj+8QerAso4JKo/jrGmH/Zj7oToKoSI=; b=IHNr+cY/NlZWhTJb3AXZNybh298dhn79B2AITTJj+xjmcUPkCXMa7m2VUlEKUYTXE7lpqX yzEg0XW0iYwPi1LD+iBbPifoaoK0wTvKAIBTMIGoyGoZWccU9CJrqv8nV2TVpzolH4nurl zzhWnMBP99toSsMMWYwxDLJzpe48R3w= X-MC-Unique: -IoKKtiEMlyUhlgi78Svhw-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Peter Maydell Subject: [PULL 14/56] hw/arm/armv7m: Clean up local variable shadowing Date: Fri, 29 Sep 2023 10:50:11 +0200 Message-ID: <20230929085053.2789105-15-armbru@redhat.com> In-Reply-To: <20230929085053.2789105-1-armbru@redhat.com> References: <20230929085053.2789105-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 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=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, 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 @redhat.com) X-ZM-MESSAGEID: 1695977865877100003 From: Philippe Mathieu-Daud=C3=A9 Fix: hw/arm/armv7m.c: In function =E2=80=98armv7m_realize=E2=80=99: hw/arm/armv7m.c:520:27: warning: declaration of =E2=80=98sbd=E2=80=99 sha= dows a previous local [-Wshadow=3Dcompatible-local] 520 | SysBusDevice *sbd =3D SYS_BUS_DEVICE(&s->bitband[i]); | ^~~ hw/arm/armv7m.c:278:19: note: shadowed declaration is here 278 | SysBusDevice *sbd; | ^~~ --- hw/arm/armsse.c: In function =E2=80=98armsse_realize=E2=80=99: hw/arm/armsse.c:1471:27: warning: declaration of =E2=80=98mr=E2=80=99 sha= dows a previous local [-Wshadow=3Dcompatible-local] 1471 | MemoryRegion *mr; | ^~ hw/arm/armsse.c:917:19: note: shadowed declaration is here 917 | MemoryRegion *mr; | ^~ --- hw/arm/armsse.c:1608:22: warning: declaration of =E2=80=98dev_splitter=E2= =80=99 shadows a previous local [-Wshadow=3Dcompatible-local] 1608 | DeviceState *dev_splitter =3D DEVICE(splitter); | ^~~~~~~~~~~~ hw/arm/armsse.c:923:18: note: shadowed declaration is here 923 | DeviceState *dev_splitter; | ^~~~~~~~~~~~ Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20230904161235.84651-8-philmd@linaro.org> Reviewed-by: Peter Maydell Signed-off-by: Markus Armbruster --- hw/arm/armsse.c | 16 ++++++---------- hw/arm/armv7m.c | 2 +- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/hw/arm/armsse.c b/hw/arm/armsse.c index 11cd08b6c1..31acbf7347 100644 --- a/hw/arm/armsse.c +++ b/hw/arm/armsse.c @@ -1468,7 +1468,6 @@ static void armsse_realize(DeviceState *dev, Error **= errp) if (info->has_cachectrl) { for (i =3D 0; i < info->num_cpus; i++) { char *name =3D g_strdup_printf("cachectrl%d", i); - MemoryRegion *mr; =20 qdev_prop_set_string(DEVICE(&s->cachectrl[i]), "name", name); g_free(name); @@ -1484,7 +1483,6 @@ static void armsse_realize(DeviceState *dev, Error **= errp) if (info->has_cpusecctrl) { for (i =3D 0; i < info->num_cpus; i++) { char *name =3D g_strdup_printf("CPUSECCTRL%d", i); - MemoryRegion *mr; =20 qdev_prop_set_string(DEVICE(&s->cpusecctrl[i]), "name", name); g_free(name); @@ -1499,7 +1497,6 @@ static void armsse_realize(DeviceState *dev, Error **= errp) } if (info->has_cpuid) { for (i =3D 0; i < info->num_cpus; i++) { - MemoryRegion *mr; =20 qdev_prop_set_uint32(DEVICE(&s->cpuid[i]), "CPUID", i); if (!sysbus_realize(SYS_BUS_DEVICE(&s->cpuid[i]), errp)) { @@ -1512,7 +1509,6 @@ static void armsse_realize(DeviceState *dev, Error **= errp) } if (info->has_cpu_pwrctrl) { for (i =3D 0; i < info->num_cpus; i++) { - MemoryRegion *mr; =20 if (!sysbus_realize(SYS_BUS_DEVICE(&s->cpu_pwrctrl[i]), errp))= { return; @@ -1605,7 +1601,7 @@ static void armsse_realize(DeviceState *dev, Error **= errp) /* Wire up the splitters for the MPC IRQs */ for (i =3D 0; i < IOTS_NUM_EXP_MPC + info->sram_banks; i++) { SplitIRQ *splitter =3D &s->mpc_irq_splitter[i]; - DeviceState *dev_splitter =3D DEVICE(splitter); + DeviceState *devs =3D DEVICE(splitter); =20 if (!object_property_set_int(OBJECT(splitter), "num-lines", 2, errp)) { @@ -1617,22 +1613,22 @@ static void armsse_realize(DeviceState *dev, Error = **errp) =20 if (i < IOTS_NUM_EXP_MPC) { /* Splitter input is from GPIO input line */ - s->mpcexp_status_in[i] =3D qdev_get_gpio_in(dev_splitter, 0); - qdev_connect_gpio_out(dev_splitter, 0, + s->mpcexp_status_in[i] =3D qdev_get_gpio_in(devs, 0); + qdev_connect_gpio_out(devs, 0, qdev_get_gpio_in_named(dev_secctl, "mpcexp_status", = i)); } else { /* Splitter input is from our own MPC */ qdev_connect_gpio_out_named(DEVICE(&s->mpc[i - IOTS_NUM_EXP_MP= C]), "irq", 0, - qdev_get_gpio_in(dev_splitter, 0)); - qdev_connect_gpio_out(dev_splitter, 0, + qdev_get_gpio_in(devs, 0)); + qdev_connect_gpio_out(devs, 0, qdev_get_gpio_in_named(dev_secctl, "mpc_status", i - IOTS_NUM_EXP_= MPC)); } =20 - qdev_connect_gpio_out(dev_splitter, 1, + qdev_connect_gpio_out(devs, 1, qdev_get_gpio_in(DEVICE(&s->mpc_irq_orgate),= i)); } /* Create GPIO inputs which will pass the line state for our diff --git a/hw/arm/armv7m.c b/hw/arm/armv7m.c index bf173b10b8..1f78e18872 100644 --- a/hw/arm/armv7m.c +++ b/hw/arm/armv7m.c @@ -517,7 +517,7 @@ static void armv7m_realize(DeviceState *dev, Error **er= rp) for (i =3D 0; i < ARRAY_SIZE(s->bitband); i++) { if (s->enable_bitband) { Object *obj =3D OBJECT(&s->bitband[i]); - SysBusDevice *sbd =3D SYS_BUS_DEVICE(&s->bitband[i]); + sbd =3D SYS_BUS_DEVICE(&s->bitband[i]); =20 if (!object_property_set_int(obj, "base", bitband_input_addr[i], errp)) { --=20 2.41.0 From nobody Fri May 17 11:29:14 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1695977639; cv=none; d=zohomail.com; s=zohoarc; b=I59m+xnPpmC1bocTkKBduUADdCrQ4wzh5qb500HnkdEQFLMxVfMj5P1LNgy7s3nlrCt32c1rCxuJfYcgF6h39oYSv0n9u7pegXCODAcpF3rNAeHJ0rpRperbiFPNyJsUOtXUWb5yGylZy4aJ10+Sd7uUQ415jjuhBv5ls9hbOf8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695977639; 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=GLS8hKYIud+QsFyN4gSipeI/BAQn5RSSiAuPEBlCmeE=; b=bDTw62YJEg7/bIjw3QKsYFX+HMg6gW2qTI0Br6u+kQDXTV9sr5xDxeHkUJZLMzGAFmS74YRfr66/KJDAsPkdBQq14C/2dXQA4jNIS7ioKFVW01nzRFUVFTjAsIRPn7S0yjZimbGBze5f8ujIh8MBpcTy92xnJcBgaE3+e12SFXo= 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 169597763922726.765879631827715; Fri, 29 Sep 2023 01:53:59 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qm9DZ-00058W-BG; Fri, 29 Sep 2023 04:51:25 -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 1qm9DX-00054B-6w for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:23 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qm9DC-0005cZ-Pp for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:22 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-561-NZ8KM_5dNeahbQNplMww3A-1; Fri, 29 Sep 2023 04:50:56 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 82CDD800B35; Fri, 29 Sep 2023 08:50:56 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6046E40C6EBF; Fri, 29 Sep 2023 08:50:56 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 7B17A21E691B; Fri, 29 Sep 2023 10:50:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695977460; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GLS8hKYIud+QsFyN4gSipeI/BAQn5RSSiAuPEBlCmeE=; b=LlQ322rmt7mmPxrBcWwGvGJDU64JwAUfIQJJB4P97RpiZhSxtbLCyq0UCkngBysAcXk4Ln YEM7cVLmnUuRD/jDB3SsS4CDN79CnrhmzvLsjkmVmmpZEXODO1T1E3C342/jyDu7OQ+7O3 zKO/gnZ0LDQ/OBLFFvjNko0FYyfNQ5A= X-MC-Unique: NZ8KM_5dNeahbQNplMww3A-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Peter Maydell Subject: [PULL 15/56] hw/arm/virt: Clean up local variable shadowing Date: Fri, 29 Sep 2023 10:50:12 +0200 Message-ID: <20230929085053.2789105-16-armbru@redhat.com> In-Reply-To: <20230929085053.2789105-1-armbru@redhat.com> References: <20230929085053.2789105-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 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=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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 @redhat.com) X-ZM-MESSAGEID: 1695977640226100001 From: Philippe Mathieu-Daud=C3=A9 Fix: hw/arm/virt.c:821:22: error: declaration shadows a local variable [-Werro= r,-Wshadow] qemu_irq irq =3D qdev_get_gpio_in(vms->gic, ^ hw/arm/virt.c:803:13: note: previous declaration is here int irq; ^ Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Peter Maydell Message-ID: <20230904161235.84651-9-philmd@linaro.org> Signed-off-by: Markus Armbruster --- hw/arm/virt.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 8ad78b23c2..15e74249f9 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -801,7 +801,6 @@ static void create_gic(VirtMachineState *vms, MemoryReg= ion *mem) for (i =3D 0; i < smp_cpus; i++) { DeviceState *cpudev =3D DEVICE(qemu_get_cpu(i)); int ppibase =3D NUM_IRQS + i * GIC_INTERNAL + GIC_NR_SGIS; - int irq; /* Mapping from the output timer irq lines from the CPU to the * GIC PPI inputs we use for the virt board. */ @@ -812,7 +811,7 @@ static void create_gic(VirtMachineState *vms, MemoryReg= ion *mem) [GTIMER_SEC] =3D ARCH_TIMER_S_EL1_IRQ, }; =20 - for (irq =3D 0; irq < ARRAY_SIZE(timer_irq); irq++) { + for (unsigned irq =3D 0; irq < ARRAY_SIZE(timer_irq); irq++) { qdev_connect_gpio_out(cpudev, irq, qdev_get_gpio_in(vms->gic, ppibase + timer_irq[irq= ])); --=20 2.41.0 From nobody Fri May 17 11:29:14 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1695977918; cv=none; d=zohomail.com; s=zohoarc; b=X4gCdwqJwXiHttQVMlfWgVyyjvliogbSdQWV3B9kMQbz67GVbyIJfdNDPmz0IkpkAYcO7+LWbcMyR8X8ph9FUwmCTcr2RA524vX08T6LHmvAGNFNeltEfhSOm7Fxr1yD9izdF1V4i5rmIeGVjExxn3T+WBYAoEsaTXsQE9KvFlY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695977918; 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=n6mHNfgmRFfmrHLYyODE6mZv5yjPRcsdm2kcZfvXjpY=; b=Ptd5xc6Ib2Txdjg35RWudzgwXRys8LoTGtyCnyeNAYi7BfIpx9STmNtuTT/ozqpoXiDWgtXnoG9VkiNvJwZPtiY+flNXN2bPj1Qlnq8F8EWu0bn2/y7r6y7fRsGfaW8FbJAbJye7/p8r2TOC2b0Ei+aQ2dDu4vy/kQqbt7HBogg= 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 1695977918084826.3861020208378; Fri, 29 Sep 2023 01:58:38 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qm9Dg-0005EC-5I; Fri, 29 Sep 2023 04:51:32 -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 1qm9DU-00051a-Co for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:20 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qm9DC-0005ca-K3 for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:20 -0400 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-310-1soWmgaCNZedDtQxa4npTA-1; Fri, 29 Sep 2023 04:50:56 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 893FF29AA3B9; Fri, 29 Sep 2023 08:50:56 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6645A492C37; Fri, 29 Sep 2023 08:50:56 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 7DF6321E691C; Fri, 29 Sep 2023 10:50:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695977460; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=n6mHNfgmRFfmrHLYyODE6mZv5yjPRcsdm2kcZfvXjpY=; b=gNIoHz5h4YaAJaC9+zQdsCCacrS2yUM92IQ1+Fjetz7p5oa2c2ATi73wyi2BVWIfmyQcd6 LEHiQ3u1TlJeCc8cqAo2IhHVuM6GOgWSKkoDYSIt1umlmbdFrcWE8t06iOn+0hmeOtr65G 21mv+iapwRNEkSnymApYhbohAdj2wLg= X-MC-Unique: 1soWmgaCNZedDtQxa4npTA-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Peter Maydell Subject: [PULL 16/56] hw/arm/allwinner: Clean up local variable shadowing Date: Fri, 29 Sep 2023 10:50:13 +0200 Message-ID: <20230929085053.2789105-17-armbru@redhat.com> In-Reply-To: <20230929085053.2789105-1-armbru@redhat.com> References: <20230929085053.2789105-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 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=170.10.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, 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 @redhat.com) X-ZM-MESSAGEID: 1695977919569100003 From: Philippe Mathieu-Daud=C3=A9 Fix: hw/arm/allwinner-r40.c:412:14: error: declaration shadows a local variabl= e [-Werror,-Wshadow] for (int i =3D 0; i < AW_R40_NUM_MMCS; i++) { ^ hw/arm/allwinner-r40.c:299:14: note: previous declaration is here unsigned i; ^ Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Peter Maydell Message-ID: <20230904161235.84651-10-philmd@linaro.org> Signed-off-by: Markus Armbruster --- hw/arm/allwinner-r40.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/hw/arm/allwinner-r40.c b/hw/arm/allwinner-r40.c index 7d29eb224f..a0d367c60d 100644 --- a/hw/arm/allwinner-r40.c +++ b/hw/arm/allwinner-r40.c @@ -296,10 +296,9 @@ static void allwinner_r40_realize(DeviceState *dev, Er= ror **errp) { const char *r40_nic_models[] =3D { "gmac", "emac", NULL }; AwR40State *s =3D AW_R40(dev); - unsigned i; =20 /* CPUs */ - for (i =3D 0; i < AW_R40_NUM_CPUS; i++) { + for (unsigned i =3D 0; i < AW_R40_NUM_CPUS; i++) { =20 /* * Disable secondary CPUs. Guest EL3 firmware will start @@ -335,7 +334,7 @@ static void allwinner_r40_realize(DeviceState *dev, Err= or **errp) * maintenance interrupt signal to the appropriate GIC PPI inputs, * and the GIC's IRQ/FIQ/VIRQ/VFIQ interrupt outputs to the CPU's inpu= ts. */ - for (i =3D 0; i < AW_R40_NUM_CPUS; i++) { + for (unsigned i =3D 0; i < AW_R40_NUM_CPUS; i++) { DeviceState *cpudev =3D DEVICE(&s->cpus[i]); int ppibase =3D AW_R40_GIC_NUM_SPI + i * GIC_INTERNAL + GIC_NR_SGI= S; int irq; @@ -494,7 +493,7 @@ static void allwinner_r40_realize(DeviceState *dev, Err= or **errp) qdev_get_gpio_in(DEVICE(&s->gic), AW_R40_GIC_SPI_EM= AC)); =20 /* Unimplemented devices */ - for (i =3D 0; i < ARRAY_SIZE(r40_unimplemented); i++) { + for (unsigned i =3D 0; i < ARRAY_SIZE(r40_unimplemented); i++) { create_unimplemented_device(r40_unimplemented[i].device_name, r40_unimplemented[i].base, r40_unimplemented[i].size); --=20 2.41.0 From nobody Fri May 17 11:29:14 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1695977627; cv=none; d=zohomail.com; s=zohoarc; b=cM1RAe2wDHK+YoWf0Q7CWFXfjOsWcLWrIsaCWdNEHHjYX+/MQnVl3i0bA5kdSwQSYUzqdhaPYO9OoS24rjbWc0sgOaaclNeVrj7t7Lw/F6gEUiq+TCiLWq9Jd0IxFBKKLvpDD6X32JzQfwlnbulZWEEEF0fZQYeA6gPlY4FpXKc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695977627; 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=leHG7gs8FX5ozx1PuThc684J6vqDCXFzX9PpzbgoAp4=; b=dAehbKgt2POI4B/4xS6g/SuMTczs88o8KYg/axGsHOaBCSlWrVsgVFsD1i4psLy1TcuoGYpKaNbg5LBYTLHeJ3UckktvUtxe+izx6UyqEjpAc5dSfMIdUB68eoADHYS999iux17jLfckc3DWF26KZw+M1ThenXrfC1weTlFF7AM= 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 1695977627580434.2972946697504; Fri, 29 Sep 2023 01:53:47 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qm9De-0005CM-Fe; Fri, 29 Sep 2023 04:51:30 -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 1qm9DQ-000508-TL for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:17 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qm9DB-0005cA-Ip for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:16 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-532-TJ4lZUCHPkePP2HED3Wqvw-1; Fri, 29 Sep 2023 04:50:56 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8DDAB803DBD; Fri, 29 Sep 2023 08:50:56 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6AC012026D4B; Fri, 29 Sep 2023 08:50:56 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 80EF621E6880; Fri, 29 Sep 2023 10:50:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695977460; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=leHG7gs8FX5ozx1PuThc684J6vqDCXFzX9PpzbgoAp4=; b=GVmxfLdONDHF3pJ8yITsGrZDuhkCl/5Vf2FbZMQfq1rgH8UofFc7RYle1xjXt9L567OjmV TlJLYR8jscC1GU1/Dip0TCvtruLy/lR3qjD7S7zNIlHlLx0qg7U59pJQtmmIjW5ef8VgUv 4nck108RVyOoqRrLGG7Wd6znKG19v+o= X-MC-Unique: TJ4lZUCHPkePP2HED3Wqvw-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth Subject: [PULL 17/56] hw/m68k: Clean up local variable shadowing Date: Fri, 29 Sep 2023 10:50:14 +0200 Message-ID: <20230929085053.2789105-18-armbru@redhat.com> In-Reply-To: <20230929085053.2789105-1-armbru@redhat.com> References: <20230929085053.2789105-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 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=170.10.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, T_SPF_TEMPERROR=0.01 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 @redhat.com) X-ZM-MESSAGEID: 1695977629818100007 From: Philippe Mathieu-Daud=C3=A9 Fix: hw/m68k/virt.c:263:13: error: declaration shadows a local variable [-Werr= or,-Wshadow] BOOTINFOSTR(param_ptr, BI_COMMAND_LINE, ^ hw/m68k/bootinfo.h:47:13: note: expanded from macro 'BOOTINFOSTR' int i; \ ^ hw/m68k/virt.c:130:9: note: previous declaration is here int i; ^ Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20230904161235.84651-13-philmd@linaro.org> Reviewed-by: Thomas Huth Signed-off-by: Markus Armbruster --- hw/m68k/bootinfo.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/hw/m68k/bootinfo.h b/hw/m68k/bootinfo.h index a3d37e3c80..0e6e3eea87 100644 --- a/hw/m68k/bootinfo.h +++ b/hw/m68k/bootinfo.h @@ -44,15 +44,14 @@ =20 #define BOOTINFOSTR(base, id, string) \ do { \ - int i; \ stw_p(base, id); \ base +=3D 2; \ stw_p(base, \ (sizeof(struct bi_record) + strlen(string) + \ 1 /* null termination */ + 3 /* padding */) & ~3); \ base +=3D 2; \ - for (i =3D 0; string[i]; i++) { \ - stb_p(base++, string[i]); \ + for (unsigned i_ =3D 0; string[i_]; i_++) { \ + stb_p(base++, string[i_]); \ } \ stb_p(base++, 0); \ base =3D QEMU_ALIGN_PTR_UP(base, 4); \ @@ -60,7 +59,6 @@ =20 #define BOOTINFODATA(base, id, data, len) \ do { \ - int i; \ stw_p(base, id); \ base +=3D 2; \ stw_p(base, \ @@ -69,8 +67,8 @@ base +=3D 2; \ stw_p(base, len); \ base +=3D 2; \ - for (i =3D 0; i < len; ++i) { \ - stb_p(base++, data[i]); \ + for (unsigned i_ =3D 0; i_ < len; ++i_) { \ + stb_p(base++, data[i_]); \ } \ base =3D QEMU_ALIGN_PTR_UP(base, 4); \ } while (0) --=20 2.41.0 From nobody Fri May 17 11:29:14 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1695977673; cv=none; d=zohomail.com; s=zohoarc; b=SLdCoxn6IYfmPYM4kAWgtPyix7xLLpX9Awx7yunSqVR2yGbJspWswa5rwGhPxWpX6oGSVNFa/fRzLrdVqK9mBgPT3qHejavumtV8LyBU+fJzfvgxdxeL910g6Qe9iyS4VNFXF0SEQkzQlDfMenx7HO69wn8zqZoU2CsNYZ+s27Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695977673; 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=AuY4c+rNgBEthHETX4q54zFauPLIMdPU3WaalCkJm9Q=; b=Ow4s/+B84fMw6r7RoyE1Zlqpw0qK4flPLxmeoDHd+HiECpEzKKYrexZ6SP/gmrequkfiHZ/yYLszR9smgynnvmh74//tHuGROFP59spFEZUfzhd6ILdF3MvnKH4EgcxIwKA1cdoJUVulQvqGdLnKxdb7Hodn6f32Ml1FMk09Ajc= 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 1695977673444125.99901938860762; Fri, 29 Sep 2023 01:54:33 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qm9DU-00050u-0f; Fri, 29 Sep 2023 04:51:20 -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 1qm9DK-0004xK-5s for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:11 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qm9DA-0005b8-D8 for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:08 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-561-7qdX-6meORW_pPDDNtpf7Q-1; Fri, 29 Sep 2023 04:50:56 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 92239801779; Fri, 29 Sep 2023 08:50:56 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6F52E10F1BE7; Fri, 29 Sep 2023 08:50:56 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 83B4621E6882; Fri, 29 Sep 2023 10:50:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695977458; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AuY4c+rNgBEthHETX4q54zFauPLIMdPU3WaalCkJm9Q=; b=AspphZuMzcaHL5ZbAroA5Evo5QFhaqLi73Dw5XFt2rAmc+azTfks9A+5FsQOsh/8ksA0Ik WQBFQN2XN11LnwNMVD48mcPY/53GUFvR1OnrOnHU2Q5FTIe5rhv0IurowQhw12XUbuibLH xT8IoSp4yg7DFnOG5nA9xd2L+jSB8yo= X-MC-Unique: 7qdX-6meORW_pPDDNtpf7Q-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 18/56] hw/microblaze: Clean up local variable shadowing Date: Fri, 29 Sep 2023 10:50:15 +0200 Message-ID: <20230929085053.2789105-19-armbru@redhat.com> In-Reply-To: <20230929085053.2789105-1-armbru@redhat.com> References: <20230929085053.2789105-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 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=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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 @redhat.com) X-ZM-MESSAGEID: 1695977674973100003 From: Philippe Mathieu-Daud=C3=A9 Fix: hw/microblaze/petalogix_ml605_mmu.c: In function =E2=80=98petalogix_ml605= _init=E2=80=99: hw/microblaze/petalogix_ml605_mmu.c:186:24: warning: declaration of =E2= =80=98dinfo=E2=80=99 shadows a previous local [-Wshadow=3Dcompatible-local] 186 | DriveInfo *dinfo =3D drive_get(IF_MTD, 0, i); | ^~~~~ hw/microblaze/petalogix_ml605_mmu.c:78:16: note: shadowed declaration is = here 78 | DriveInfo *dinfo; | ^~~~~ Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20230904161235.84651-14-philmd@linaro.org> Signed-off-by: Markus Armbruster --- hw/microblaze/petalogix_ml605_mmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/microblaze/petalogix_ml605_mmu.c b/hw/microblaze/petalogix_= ml605_mmu.c index ea0fb68cf0..fb7889cf67 100644 --- a/hw/microblaze/petalogix_ml605_mmu.c +++ b/hw/microblaze/petalogix_ml605_mmu.c @@ -183,7 +183,7 @@ petalogix_ml605_init(MachineState *machine) spi =3D (SSIBus *)qdev_get_child_bus(dev, "spi"); =20 for (i =3D 0; i < NUM_SPI_FLASHES; i++) { - DriveInfo *dinfo =3D drive_get(IF_MTD, 0, i); + dinfo =3D drive_get(IF_MTD, 0, i); qemu_irq cs_line; =20 dev =3D qdev_new("n25q128"); --=20 2.41.0 From nobody Fri May 17 11:29:14 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1695977532; cv=none; d=zohomail.com; s=zohoarc; b=I3aAHv/8Qa6MGbIsEgqIWUblODqV1eKJZNvA6SoGrraji7wOnB1IinON9Vh4pJFL1G4qFJKTh1iSnpFZEoft5MxkFnFZz7VSHcg7tudHQjf/ObEh2vniBnS2yNB2vxZ0YHj5jv7umP8Py99yjKqSn/3KmQoUYiy9e+SuKod7z24= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695977532; 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=oTfBkhZ+AkKmfYBoreBoF3jgEy3JllYH6NEQgZ8yaMM=; b=NvxaYUSgPg02Vp8pJL3lZ6u9roE7ENbFvXLMLiMzq3+64LIjU1cxHyrB8Ph0hZpmI1FQh5wDUs1CygWOf23Ju07NtWMxJPIcI2SK8q6/CLuppi4RrFnib3MaQxkvNlOKFhsrkJ72Mx1x7TbZ17ytz7NGrEJb5+jSk5Xd/QcJvRA= 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 1695977532325284.30387194069124; Fri, 29 Sep 2023 01:52:12 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qm9DW-00053D-K9; Fri, 29 Sep 2023 04:51:22 -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 1qm9DK-0004xL-6U for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:11 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qm9DA-0005bd-Dy for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:09 -0400 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-63-u7304ZHvO2OA3DKAAeGKlA-1; Fri, 29 Sep 2023 04:50:57 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 987B03C025C7; Fri, 29 Sep 2023 08:50:56 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7661540C6EC0; Fri, 29 Sep 2023 08:50:56 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 8682421E6883; Fri, 29 Sep 2023 10:50:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695977459; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oTfBkhZ+AkKmfYBoreBoF3jgEy3JllYH6NEQgZ8yaMM=; b=Aq1osLUdM5pkvmOJs1uN4JEbgeajWZa5pIHjJEuyQWhlqncZKTR9pcem2f9Tsh7XiN9RgQ 4i1PUiSzoVhCdIPW7hzOQEVwJwZCyrYSR4QP17Q0tVWUt2PiwMMzjuBogbAjJC7vnnsKkh NyHD95UxXnUviqeCFL/+HxS05ZGtIo8= X-MC-Unique: u7304ZHvO2OA3DKAAeGKlA-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 19/56] hw/nios2: Clean up local variable shadowing Date: Fri, 29 Sep 2023 10:50:16 +0200 Message-ID: <20230929085053.2789105-20-armbru@redhat.com> In-Reply-To: <20230929085053.2789105-1-armbru@redhat.com> References: <20230929085053.2789105-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 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=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, 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 @redhat.com) X-ZM-MESSAGEID: 1695977534022100011 From: Philippe Mathieu-Daud=C3=A9 Fix: hw/nios2/10m50_devboard.c: In function =E2=80=98nios2_10m50_ghrd_init=E2= =80=99: hw/nios2/10m50_devboard.c:101:22: warning: declaration of =E2=80=98dev=E2= =80=99 shadows a previous local [-Wshadow=3Dcompatible-local] 101 | DeviceState *dev =3D qdev_new(TYPE_NIOS2_VIC); | ^~~ hw/nios2/10m50_devboard.c:60:18: note: shadowed declaration is here 60 | DeviceState *dev; | ^~~ hw/nios2/10m50_devboard.c:110:18: warning: declaration of =E2=80=98i=E2= =80=99 shadows a previous local [-Wshadow=3Dcompatible-local] 110 | for (int i =3D 0; i < 32; i++) { | ^ hw/nios2/10m50_devboard.c:67:9: note: shadowed declaration is here 67 | int i; | ^ Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20230904161235.84651-15-philmd@linaro.org> Signed-off-by: Markus Armbruster --- hw/nios2/10m50_devboard.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/nios2/10m50_devboard.c b/hw/nios2/10m50_devboard.c index 91383fb097..952a0dc33e 100644 --- a/hw/nios2/10m50_devboard.c +++ b/hw/nios2/10m50_devboard.c @@ -98,7 +98,7 @@ static void nios2_10m50_ghrd_init(MachineState *machine) qdev_realize_and_unref(DEVICE(cpu), NULL, &error_fatal); =20 if (nms->vic) { - DeviceState *dev =3D qdev_new(TYPE_NIOS2_VIC); + dev =3D qdev_new(TYPE_NIOS2_VIC); MemoryRegion *dev_mr; qemu_irq cpu_irq; =20 @@ -107,7 +107,7 @@ static void nios2_10m50_ghrd_init(MachineState *machine) =20 cpu_irq =3D qdev_get_gpio_in_named(DEVICE(cpu), "EIC", 0); sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, cpu_irq); - for (int i =3D 0; i < 32; i++) { + for (i =3D 0; i < 32; i++) { irq[i] =3D qdev_get_gpio_in(dev, i); } =20 --=20 2.41.0 From nobody Fri May 17 11:29:14 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1695977932; cv=none; d=zohomail.com; s=zohoarc; b=YIlug9QLIjIquPZcMLRoUg3vScx8xYYwMvD7BEjsJFdvx97ksXfJzonKYu341fU2ufMyzQiMjESZAq1KlTPUpBB32lqmAWXrof7EZwYgCakoSA1gD+vXeUgoamTdj5BZ1Ipzk8B0BKIRPYyX1VEbcleOIU64fCHGOQxNGha2QJM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695977932; 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=RblW5yTCxDRLJKGfYdaOTh+OR9JgnGGeaSPLNcKIiEI=; b=PqSqCRigHKzI7oE1uuPZqb2k7NmhxaFJpw7/8uXcsOetVRhMoRZKvSuLzepuYDWOGihCmFBDWtojWBzJxOHcwGut40LllrN6/cK2ryzsBnDjVUL+hJPprfBU0/AYnF6x+HhkB1EKyvBzvGqx4Ap+UdHmYtlylBLhyRaYs0RUHeA= 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 1695977932488159.82546461709683; Fri, 29 Sep 2023 01:58:52 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qm9Dg-0005F0-QZ; Fri, 29 Sep 2023 04:51:33 -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 1qm9DX-00055g-CK for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:23 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qm9DC-0005cJ-Qd for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:23 -0400 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-474-4mEqS7yhOa-bqshfaQiCSg-1; Fri, 29 Sep 2023 04:50:58 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 03CE31C08974; Fri, 29 Sep 2023 08:50:58 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9A0D614171B6; Fri, 29 Sep 2023 08:50:57 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 896F021E6884; Fri, 29 Sep 2023 10:50:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695977460; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RblW5yTCxDRLJKGfYdaOTh+OR9JgnGGeaSPLNcKIiEI=; b=IFvyYqqszX13OwwLKTHRJiD5b5shUey++K2sQWRYT5orypy41WdE3yI8HEkFzNWKPVb8ao y2fBjW4bwwrSH8NyNCqG7UBGPHGTa0zocYF/9eTns8oez/aVZN0KO8wtmdSuIHnBjMnwCG guTdd2zkf7OHlbNisFgKgYSofaOtgDs= X-MC-Unique: 4mEqS7yhOa-bqshfaQiCSg-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Akihiko Odaki , Eric Blake Subject: [PULL 20/56] net/eth: Clean up local variable shadowing Date: Fri, 29 Sep 2023 10:50:17 +0200 Message-ID: <20230929085053.2789105-21-armbru@redhat.com> In-Reply-To: <20230929085053.2789105-1-armbru@redhat.com> References: <20230929085053.2789105-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 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=170.10.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, 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 @redhat.com) X-ZM-MESSAGEID: 1695977933908100003 From: Philippe Mathieu-Daud=C3=A9 Fix: net/eth.c:435:20: error: declaration shadows a local variable [-Werror,-W= shadow] size_t input_size =3D iov_size(pkt, pkt_frags); ^ net/eth.c:413:16: note: previous declaration is here size_t input_size =3D iov_size(pkt, pkt_frags); ^ Suggested-by: Akihiko Odaki Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20230904161235.84651-16-philmd@linaro.org> Reviewed-by: Eric Blake Reviewed-by: Akihiko Odaki Signed-off-by: Markus Armbruster --- net/eth.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/net/eth.c b/net/eth.c index 649e66bb1f..3f680cc033 100644 --- a/net/eth.c +++ b/net/eth.c @@ -432,8 +432,6 @@ _eth_get_rss_ex_src_addr(const struct iovec *pkt, int p= kt_frags, } =20 if (opthdr.type =3D=3D IP6_OPT_HOME) { - size_t input_size =3D iov_size(pkt, pkt_frags); - if (input_size < opt_offset + sizeof(opthdr)) { return false; } --=20 2.41.0 From nobody Fri May 17 11:29:14 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1695977752; cv=none; d=zohomail.com; s=zohoarc; b=hOZ2iLUMkdLpKgDl2IiaMeGvHff/7bGQcIhlgWoowda+y2Ez894aqKWUWg1Wo1qOmtSNUiCFw+N6l9dHvwJZ6bevPv7ePtyYDqd/SGPtudDCRv5wpGsSsCJNWOfP7RQvWej7yN2EnpAWtvNT/yLsn7ORcIXtol8zWmoXOoun+LU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695977752; 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=cyEEDeIM4t46x5VE8Yy+9CWu9nyYvBCMyGW0Sl7OzfA=; b=kl5K1UAIfQOyfWLhETFwV6qF5Ajw/Oicf3miG5kxtjXH/5NUI3Hg284sZneIYNJ9MPjIkJtK/+Yy4DrHR+YP4lGfYyysXJhwocbgfS7/4JkdohfF+bunAGMc3p0f11EikuO0C7tQrSVetP/zfJvhQUWW7MR6DY4EY0oQH6BiM7E= 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 1695977752411397.1230852097309; Fri, 29 Sep 2023 01:55:52 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qm9Dm-0005Jb-PV; Fri, 29 Sep 2023 04:51:38 -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 1qm9Dc-0005C8-S3 for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:29 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qm9DC-0005cN-U2 for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:27 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-63-a41chQclPAaxLWACUwuhyw-1; Fri, 29 Sep 2023 04:50:57 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A4B8F185A78E; Fri, 29 Sep 2023 08:50:56 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 81D362026D68; Fri, 29 Sep 2023 08:50:56 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 8C3E121E6885; Fri, 29 Sep 2023 10:50:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695977460; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cyEEDeIM4t46x5VE8Yy+9CWu9nyYvBCMyGW0Sl7OzfA=; b=NkL4Gb+HNf48faffJgbpJo2MboXWLCLcLZCqpdJ11yx2pUf7sJgrmLhMJxnkIfYykquikZ i4kNpS0GpWEadjHiOT6X0hzh0AO9qj6CqY/etrHZgOBzn46YwvWpawGN7Bksj03HQ35OFD fIeGqADm5QPHTY6BK1+MieBxxsMR4Hc= X-MC-Unique: a41chQclPAaxLWACUwuhyw-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= Subject: [PULL 21/56] crypto/cipher-gnutls.c: Clean up local variable shadowing Date: Fri, 29 Sep 2023 10:50:18 +0200 Message-ID: <20230929085053.2789105-22-armbru@redhat.com> In-Reply-To: <20230929085053.2789105-1-armbru@redhat.com> References: <20230929085053.2789105-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 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=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_PASS=-0.001, T_SPF_HELO_TEMPERROR=0.01 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 @redhat.com) X-ZM-MESSAGEID: 1695977753209100003 From: Philippe Mathieu-Daud=C3=A9 Fix: In file included from crypto/cipher.c:140: crypto/cipher-gnutls.c.inc: In function =E2=80=98qcrypto_gnutls_cipher_en= crypt=E2=80=99: crypto/cipher-gnutls.c.inc:116:17: warning: declaration of =E2=80=98err= =E2=80=99 shadows a previous local [-Wshadow=3Dcompatible-local] 116 | int err =3D gnutls_cipher_init(&handle, ctx->galg, &g= key, NULL); | ^~~ crypto/cipher-gnutls.c.inc:94:9: note: shadowed declaration is here 94 | int err; | ^~~ --- crypto/cipher-gnutls.c.inc: In function =E2=80=98qcrypto_gnutls_cipher_de= crypt=E2=80=99: crypto/cipher-gnutls.c.inc:177:17: warning: declaration of =E2=80=98err= =E2=80=99 shadows a previous local [-Wshadow=3Dcompatible-local] 177 | int err =3D gnutls_cipher_init(&handle, ctx->galg, &g= key, NULL); | ^~~ crypto/cipher-gnutls.c.inc:154:9: note: shadowed declaration is here 154 | int err; | ^~~ Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20230904161235.84651-17-philmd@linaro.org> Reviewed-by: Daniel P. Berrang=C3=A9 Signed-off-by: Markus Armbruster --- crypto/cipher-gnutls.c.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crypto/cipher-gnutls.c.inc b/crypto/cipher-gnutls.c.inc index 501e4e07a5..d3e231c13c 100644 --- a/crypto/cipher-gnutls.c.inc +++ b/crypto/cipher-gnutls.c.inc @@ -113,7 +113,7 @@ qcrypto_gnutls_cipher_encrypt(QCryptoCipher *cipher, while (len) { gnutls_cipher_hd_t handle; gnutls_datum_t gkey =3D { (unsigned char *)ctx->key, ctx->nkey= }; - int err =3D gnutls_cipher_init(&handle, ctx->galg, &gkey, NULL= ); + err =3D gnutls_cipher_init(&handle, ctx->galg, &gkey, NULL); if (err !=3D 0) { error_setg(errp, "Cannot initialize cipher: %s", gnutls_strerror(err)); @@ -174,7 +174,7 @@ qcrypto_gnutls_cipher_decrypt(QCryptoCipher *cipher, while (len) { gnutls_cipher_hd_t handle; gnutls_datum_t gkey =3D { (unsigned char *)ctx->key, ctx->nkey= }; - int err =3D gnutls_cipher_init(&handle, ctx->galg, &gkey, NULL= ); + err =3D gnutls_cipher_init(&handle, ctx->galg, &gkey, NULL); if (err !=3D 0) { error_setg(errp, "Cannot initialize cipher: %s", gnutls_strerror(err)); --=20 2.41.0 From nobody Fri May 17 11:29:14 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1695977751; cv=none; d=zohomail.com; s=zohoarc; b=bXsBBoYrWtJSLiOJdc/BW0Ji2c+ETXDuPr4wvg+hfbrIw8zyX045Ep4mtSWgKDYNLxr9QmOo5KCJxKTeG/Tdr+BaoQ5zQ6PoHl9BYs165FpBBvrJhNnDXPVt1KrarnbLSMz2Pm18fjuxtm+9Od59E2Z9VL/m+xjVpiv8DEoYePo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695977751; 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=5xtaxu9vx6HTcALqnXkzmf305ZuqxOnzTYiMi68kHS8=; b=WZSu9ahTE54uHRaAExUZ9d5O1UvwjW5aZtY5rHgI8QwuXoIFkEHwCxhM9zRrUezXlwOsgAE28BpsWfd2vMAw1OtSC9pUqMUNfa9tpJRO8HVVaVWnYvOCH6RxeYu3omXlKynopERXRv9am90n23VKgxCoYYrwSEnu71SaMEQM4lg= 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 1695977751630159.7518856435113; Fri, 29 Sep 2023 01:55:51 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qm9DZ-000589-2o; Fri, 29 Sep 2023 04:51:25 -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 1qm9DS-00050W-8m for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:19 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qm9DB-0005ck-RV for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:17 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-472-jZoZGFg6M7-2PSuUR5K9-Q-1; Fri, 29 Sep 2023 04:50:56 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A4DB885A5BE; Fri, 29 Sep 2023 08:50:56 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 827E340C6EC1; Fri, 29 Sep 2023 08:50:56 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 8F02021E6886; Fri, 29 Sep 2023 10:50:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695977461; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5xtaxu9vx6HTcALqnXkzmf305ZuqxOnzTYiMi68kHS8=; b=Fpd9ez7XFZF7MI+fgx7PGyYYwpGJVfel0jF52W51rEqb2eeL57iYxfKoptDEHVobe4ITXl 28PBRx1fHN1QFhb2ECmux+AHpvfhw38nQCOLxD5gbFpbA9K2C/tKMus5RfWag3a2d3KM1J Jsfaj8ZXcDC1tL+K3uiSJ480I3jiDDk= X-MC-Unique: jZoZGFg6M7-2PSuUR5K9-Q-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Michael S . Tsirkin" Subject: [PULL 22/56] util/vhost-user-server: Clean up local variable shadowing Date: Fri, 29 Sep 2023 10:50:19 +0200 Message-ID: <20230929085053.2789105-23-armbru@redhat.com> In-Reply-To: <20230929085053.2789105-1-armbru@redhat.com> References: <20230929085053.2789105-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 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=170.10.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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 @redhat.com) X-ZM-MESSAGEID: 1695977752386100001 From: Philippe Mathieu-Daud=C3=A9 Fix: util/vhost-user-server.c: In function =E2=80=98set_watch=E2=80=99: util/vhost-user-server.c:274:20: warning: declaration of =E2=80=98vu_fd_w= atch=E2=80=99 shadows a previous local [-Wshadow=3Dcompatible-local] 274 | VuFdWatch *vu_fd_watch =3D g_new0(VuFdWatch, 1); | ^~~~~~~~~~~ util/vhost-user-server.c:271:16: note: shadowed declaration is here 271 | VuFdWatch *vu_fd_watch =3D find_vu_fd_watch(server, fd); | ^~~~~~~~~~~ Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20230904161235.84651-18-philmd@linaro.org> Reviewed-by: Michael S. Tsirkin Signed-off-by: Markus Armbruster --- util/vhost-user-server.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/vhost-user-server.c b/util/vhost-user-server.c index b4b6bf30a2..5ccc6d24a0 100644 --- a/util/vhost-user-server.c +++ b/util/vhost-user-server.c @@ -278,7 +278,7 @@ set_watch(VuDev *vu_dev, int fd, int vu_evt, VuFdWatch *vu_fd_watch =3D find_vu_fd_watch(server, fd); =20 if (!vu_fd_watch) { - VuFdWatch *vu_fd_watch =3D g_new0(VuFdWatch, 1); + vu_fd_watch =3D g_new0(VuFdWatch, 1); =20 QTAILQ_INSERT_TAIL(&server->vu_fd_watches, vu_fd_watch, next); =20 --=20 2.41.0 From nobody Fri May 17 11:29:14 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1695977767; cv=none; d=zohomail.com; s=zohoarc; b=nT8/G+C/6vcAFqkCzQ+02fnrOXUfEA0Pv5XNpeg3rE1X5iVzI05A11bNtFIeNkYR+Ptdj2P/SSeX+3cUGk7A279nyUEkhISj+zmQspSn9bC6cTDMgO2JnNhLXClmxQf9aJLMNzNQuTVRRd0/Q4a+LGvqHPzrmHYCh8ugkT/0ShE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695977767; 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=EzuqQcLXPkEwoJkgWGFTACoAmjwA24zZHh83aGo4fhg=; b=FeCHN7ONDZe6WLssKtjB7Vqto3Ylo3sHCEtJDOrRiS7Ikhpk3tUhs2rxAFp4ANfKcFE+rFfD2vdLK0o3Iv4az1yExhR7SWVOVjIaWYbH35HB3G/Z5sHYdpO/z0O+Rb64QEY3qWw3vH3n2u+C+/2wcberth0+NVNDuCbixpH2qVk= 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 16959777679143.260071893496388; Fri, 29 Sep 2023 01:56:07 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qm9Dj-0005Gl-1r; Fri, 29 Sep 2023 04:51:35 -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 1qm9DQ-00050A-VQ for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:17 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qm9DB-0005cg-Pm for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:16 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-693-1RxhfZimOkSXlzdINSbOpg-1; Fri, 29 Sep 2023 04:50:57 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A8F6A185A79B; Fri, 29 Sep 2023 08:50:56 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 86C29C15BB8; Fri, 29 Sep 2023 08:50:56 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 91D6A21E6887; Fri, 29 Sep 2023 10:50:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695977461; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EzuqQcLXPkEwoJkgWGFTACoAmjwA24zZHh83aGo4fhg=; b=OVuAXnWaRL+awcw95w845dYhzOzbhuc/yTdUVKwnXqdHFrTRkjsJRiYlw0NFzO+R7VACRs mPy9px+rfB9SussUmJtYRodTieUdEK/tmsD7kE2JKrIkxXXDUo4y7VN/spGDs7nU5iHm5W TsPtEhhZa8No098qYOdaXWY89bTPnGE= X-MC-Unique: 1RxhfZimOkSXlzdINSbOpg-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 23/56] linux-user/strace: Clean up local variable shadowing Date: Fri, 29 Sep 2023 10:50:20 +0200 Message-ID: <20230929085053.2789105-24-armbru@redhat.com> In-Reply-To: <20230929085053.2789105-1-armbru@redhat.com> References: <20230929085053.2789105-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 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=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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 @redhat.com) X-ZM-MESSAGEID: 1695977768630100001 From: Philippe Mathieu-Daud=C3=A9 Fix: linux-user/strace.c: In function =E2=80=98print_sockaddr=E2=80=99: linux-user/strace.c:370:17: warning: declaration of =E2=80=98i=E2=80=99 s= hadows a previous local [-Wshadow=3Dcompatible-local] 370 | int i; | ^ linux-user/strace.c:361:9: note: shadowed declaration is here 361 | int i; | ^ Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20230904161235.84651-20-philmd@linaro.org> Signed-off-by: Markus Armbruster --- linux-user/strace.c | 1 - 1 file changed, 1 deletion(-) diff --git a/linux-user/strace.c b/linux-user/strace.c index e0ab8046ec..cf26e55264 100644 --- a/linux-user/strace.c +++ b/linux-user/strace.c @@ -367,7 +367,6 @@ print_sockaddr(abi_ulong addr, abi_long addrlen, int la= st) switch (sa_family) { case AF_UNIX: { struct target_sockaddr_un *un =3D (struct target_sockaddr_un *= )sa; - int i; qemu_log("{sun_family=3DAF_UNIX,sun_path=3D\""); for (i =3D 0; i < addrlen - offsetof(struct target_sockaddr_un, sun_path) = && --=20 2.41.0 From nobody Fri May 17 11:29:14 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1695977612; cv=none; d=zohomail.com; s=zohoarc; b=ZHBTjH5y+FUGDp4AEvl/SA7h/CIJ5lFvjy3hBetkYtw0S1NGw33EGLDx8+BwtXklgkbVG2tQL/MEo3FcdUVYRJVRKKaEfqOZBa512XH10qGAevflb+WEHdSAkC6GZt68PXrGUnv1WxUEjz+ndjdOpsk7LWw7HBu+LX04R6wqQQY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695977612; 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=dGZdvVBakkMPiy5r9uddsx0SOw4gUpw7qzyBErOGYps=; b=niXEJTDgxHpajPdgUaV+prY8WY+T+lxwQUhWMb3vPAUy7B+kIBdSqEXHOSeK/fNmaGqW+ZFuspe+NehIUKkJX/YppYTe6jk/Fym471WBxPpt57kGQEYJcDnH1dqNAyQ5Pkk8ZAJVkdr7XThvZ1Ucf6nwPJ/fqvL+26pkaptnTfI= 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 1695977612528834.1713399223368; Fri, 29 Sep 2023 01:53:32 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qm9Dk-0005Il-P8; Fri, 29 Sep 2023 04:51:36 -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 1qm9Db-0005Be-Np for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:27 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qm9DB-0005cd-NH for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:27 -0400 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-561-FN3ZuuFPMVCZMa1O0EfefA-1; Fri, 29 Sep 2023 04:50:57 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id AABCB1C05149; Fri, 29 Sep 2023 08:50:56 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 88C8A40C2064; Fri, 29 Sep 2023 08:50:56 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 949B321E6888; Fri, 29 Sep 2023 10:50:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695977461; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dGZdvVBakkMPiy5r9uddsx0SOw4gUpw7qzyBErOGYps=; b=hhRLaGldmF4+TLQuXI9fh9BQsxy5WInhvof1Wi8FigXYS1pzJ4Nt3DbgXXPtwvrfC+DY1o /ko4Dj5dhaW96aaw5KEwBia4S6F43pQpHEYSTBxvt5nF3/NAtUgrVEqmYfiGU23I0cjprA WY5vAZY1QhOpsWZJtk0E7mHkAQozrog= X-MC-Unique: FN3ZuuFPMVCZMa1O0EfefA-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 24/56] sysemu/device_tree: Clean up local variable shadowing Date: Fri, 29 Sep 2023 10:50:21 +0200 Message-ID: <20230929085053.2789105-25-armbru@redhat.com> In-Reply-To: <20230929085053.2789105-1-armbru@redhat.com> References: <20230929085053.2789105-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 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=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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 @redhat.com) X-ZM-MESSAGEID: 1695977613875100003 From: Philippe Mathieu-Daud=C3=A9 Fix: hw/mips/boston.c:472:5: error: declaration shadows a local variable [-Wer= ror,-Wshadow] qemu_fdt_setprop_cells(fdt, name, "reg", reg_base, reg_size); ^ include/sysemu/device_tree.h:129:13: note: expanded from macro 'qemu_fdt_= setprop_cells' int i; ^ hw/mips/boston.c:461:9: note: previous declaration is here int i; ^ Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20230904161235.84651-21-philmd@linaro.org> Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster --- include/sysemu/device_tree.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/include/sysemu/device_tree.h b/include/sysemu/device_tree.h index ca5339beae..8eab395934 100644 --- a/include/sysemu/device_tree.h +++ b/include/sysemu/device_tree.h @@ -126,10 +126,8 @@ int qemu_fdt_add_path(void *fdt, const char *path); #define qemu_fdt_setprop_cells(fdt, node_path, property, ...) = \ do { = \ uint32_t qdt_tmp[] =3D { __VA_ARGS__ }; = \ - int i; = \ - = \ - for (i =3D 0; i < ARRAY_SIZE(qdt_tmp); i++) { = \ - qdt_tmp[i] =3D cpu_to_be32(qdt_tmp[i]); = \ + for (unsigned i_ =3D 0; i_ < ARRAY_SIZE(qdt_tmp); i_++) { = \ + qdt_tmp[i_] =3D cpu_to_be32(qdt_tmp[i_]); = \ } = \ qemu_fdt_setprop(fdt, node_path, property, qdt_tmp, = \ sizeof(qdt_tmp)); = \ --=20 2.41.0 From nobody Fri May 17 11:29:14 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1695977602; cv=none; d=zohomail.com; s=zohoarc; b=i/fjf4NMdipRU6QVmx04Wzh9ASnDs2FCdVd4rqucIV5zi1ka3q52LZpMszXcJeq3aevlxzhAlofnSrS6SdVLdF5ieRZRZCx+53EpRRbinRPPBhFnLEs1s1z43P5pJLSmt/Vhkbo1MVCm3yRo612dxucbddn988vsoYTBv/m75og= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695977602; 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=b/5nebuArM3BUaPbXl0XGZrfg9ZeOX0VBSaMHR6v93I=; b=HHkKWdRsBsYD18kAEwDwvZCDpaWtMwNXch2DHojKfeTMzWCgE6MTAQuudiqlAuDhQxA7igYf8FA/tJXbwI/Fp0qmb8IcIEud5CbXhIKCKxL7N5eZzs+I+t9qF0XAWg2RJN7LPVrcRVh/iKyxJMkyWh6CFFf86bTSqUgJqK3g6dc= 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 1695977602865562.4362431787272; Fri, 29 Sep 2023 01:53:22 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qm9Dj-0005Gs-8X; Fri, 29 Sep 2023 04:51:35 -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 1qm9DT-00050j-2o for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:19 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qm9DC-0005cW-HH for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:18 -0400 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-472-qDLvY7ZKNgGkFcMdGCMX_A-1; Fri, 29 Sep 2023 04:50:57 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B55A53806739; Fri, 29 Sep 2023 08:50:56 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 93A6740C2070; Fri, 29 Sep 2023 08:50:56 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 9767A21E688A; Fri, 29 Sep 2023 10:50:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695977460; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=b/5nebuArM3BUaPbXl0XGZrfg9ZeOX0VBSaMHR6v93I=; b=Q5lGTLwBM9DOl/UWHyUnniZeuKWQxc13AJYgC7qHPwBjbocoMq5rHeuFWdo4WA0RUOTANN D5svc/2vqUwlv5IbpMhHrfGJ+RkBd6hoqHWVfuAtrJ4w4U5Lo/j7y4dW4rYplYaUn5cEgQ FqxqU0tjqprj1/eSHuX/x05xQZajMi0= X-MC-Unique: qDLvY7ZKNgGkFcMdGCMX_A-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Peter Xu Subject: [PULL 25/56] softmmu/memory: Clean up local variable shadowing Date: Fri, 29 Sep 2023 10:50:22 +0200 Message-ID: <20230929085053.2789105-26-armbru@redhat.com> In-Reply-To: <20230929085053.2789105-1-armbru@redhat.com> References: <20230929085053.2789105-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 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=170.10.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, 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 @redhat.com) X-ZM-MESSAGEID: 1695977603472100001 From: Philippe Mathieu-Daud=C3=A9 Fix: softmmu/memory.c: In function =E2=80=98mtree_print_mr=E2=80=99: softmmu/memory.c:3236:27: warning: declaration of =E2=80=98ml=E2=80=99 sh= adows a previous local [-Wshadow=3Dcompatible-local] 3236 | MemoryRegionList *ml; | ^~ softmmu/memory.c:3213:32: note: shadowed declaration is here 3213 | MemoryRegionList *new_ml, *ml, *next_ml; | ^~ Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20230904161235.84651-22-philmd@linaro.org> Reviewed-by: Peter Xu Signed-off-by: Markus Armbruster --- softmmu/memory.c | 1 - 1 file changed, 1 deletion(-) diff --git a/softmmu/memory.c b/softmmu/memory.c index c0383a163d..234bd7b116 100644 --- a/softmmu/memory.c +++ b/softmmu/memory.c @@ -3245,7 +3245,6 @@ static void mtree_print_mr(const MemoryRegion *mr, un= signed int level, } =20 if (mr->alias) { - MemoryRegionList *ml; bool found =3D false; =20 /* check if the alias is already in the queue */ --=20 2.41.0 From nobody Fri May 17 11:29:14 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1695977806; cv=none; d=zohomail.com; s=zohoarc; b=URoGtaJn28BLoo1lunR6zJTQwn1pYEzKtoZcxNU3XAo6L1XC8HiiMnWNx9iy3jRaEs1m2l9U1AL4KuKYbJUJirdG+dw9cSp2oWlKzKxqtXFCxkRwo7YKS9DhnbFxJwCIwoPAqlmcNhe8nDdaW5juyhpDttGMOE8b5mP21T1KNvM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695977806; 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=7UV48sbdVMGeVoWJq1kENky0JQ2CPBfQXeo/C7cSXh8=; b=eiCNcdPZZ0vDQgBuCSqdBPadTTrAH5SRXrmEEs3c0jTlXVllfT28mRtFDpCQakgFgUvb8qH0cGEF6iBqNWOy87CvSF6uxu6bCGJBF8N6A2umLIkQBAqqxC+qzf24WIdDX+Q8MWsk1xAIjlG+YoernrkrXBJOZnrTtjiw86WrAoI= 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 1695977806347383.53163243368294; Fri, 29 Sep 2023 01:56:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qm9Dl-0005J2-Bq; Fri, 29 Sep 2023 04:51:37 -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 1qm9Dc-0005Bp-FF for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:28 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qm9DE-0005cP-T2 for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:28 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-310-ciDaImPKPEi6iFP2pYk-5Q-1; Fri, 29 Sep 2023 04:50:57 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B66C4811E86; Fri, 29 Sep 2023 08:50:56 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 93827492B16; Fri, 29 Sep 2023 08:50:56 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 9A4F021E688B; Fri, 29 Sep 2023 10:50:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695977460; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7UV48sbdVMGeVoWJq1kENky0JQ2CPBfQXeo/C7cSXh8=; b=XY3aWqCY+N71Qt32+G/w+aL7ldDcN60kahxEYPGj4fxsqxaf/Sn5Tt0Nosamdyi8olRWyq vJcakSBmCMz0hBVxdwxXuRjqO7iPXRAdaQFW88l80TBjt0fW6nTAJca3j0MnjT9HoiSwdV VKAbH5znI87tFInOmz+V5NEvqtAoqbY= X-MC-Unique: ciDaImPKPEi6iFP2pYk-5Q-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= , Peter Xu Subject: [PULL 26/56] softmmu/physmem: Clean up local variable shadowing Date: Fri, 29 Sep 2023 10:50:23 +0200 Message-ID: <20230929085053.2789105-27-armbru@redhat.com> In-Reply-To: <20230929085053.2789105-1-armbru@redhat.com> References: <20230929085053.2789105-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 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=170.10.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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 @redhat.com) X-ZM-MESSAGEID: 1695977806918100001 From: Philippe Mathieu-Daud=C3=A9 Fix: softmmu/physmem.c: In function =E2=80=98cpu_physical_memory_snapshot_and_= clear_dirty=E2=80=99: softmmu/physmem.c:916:27: warning: declaration of =E2=80=98offset=E2=80= =99 shadows a parameter [-Wshadow=3Dcompatible-local] 916 | unsigned long offset =3D page % DIRTY_MEMORY_BLOCK_SI= ZE; | ^~~~~~ softmmu/physmem.c:892:31: note: shadowed declaration is here 892 | (MemoryRegion *mr, hwaddr offset, hwaddr length, unsigned cli= ent) | ~~~~~~~^~~~~~ Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20230904161235.84651-23-philmd@linaro.org> Reviewed-by: Daniel P. Berrang=C3=A9 Reviewed-by: Peter Xu Signed-off-by: Markus Armbruster --- softmmu/physmem.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/softmmu/physmem.c b/softmmu/physmem.c index 4f6ca653b3..309653c722 100644 --- a/softmmu/physmem.c +++ b/softmmu/physmem.c @@ -913,16 +913,16 @@ DirtyBitmapSnapshot *cpu_physical_memory_snapshot_and= _clear_dirty =20 while (page < end) { unsigned long idx =3D page / DIRTY_MEMORY_BLOCK_SIZE; - unsigned long offset =3D page % DIRTY_MEMORY_BLOCK_SIZE; + unsigned long ofs =3D page % DIRTY_MEMORY_BLOCK_SIZE; unsigned long num =3D MIN(end - page, - DIRTY_MEMORY_BLOCK_SIZE - offset); + DIRTY_MEMORY_BLOCK_SIZE - ofs); =20 - assert(QEMU_IS_ALIGNED(offset, (1 << BITS_PER_LEVEL))); + assert(QEMU_IS_ALIGNED(ofs, (1 << BITS_PER_LEVEL))); assert(QEMU_IS_ALIGNED(num, (1 << BITS_PER_LEVEL))); - offset >>=3D BITS_PER_LEVEL; + ofs >>=3D BITS_PER_LEVEL; =20 bitmap_copy_and_clear_atomic(snap->dirty + dest, - blocks->blocks[idx] + offset, + blocks->blocks[idx] + ofs, num); page +=3D num; dest +=3D num >> BITS_PER_LEVEL; --=20 2.41.0 From nobody Fri May 17 11:29:14 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1695977831; cv=none; d=zohomail.com; s=zohoarc; b=GE6/PyBR1556bgRrzXJhuofRz5QENwISpEyK72px0S11YzRbf3sdMscNuwSShV8tyK5a4isPiyknF3tKLfdXi3LlIMCZ7Dsa1ViLDBkmIvW9BXe75JjgiPo8m297eCdjaE8dJOfK+cokpDoewPMX8gYF7C2M5KblwNrng4Nvp1E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695977831; 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=CSABX0JFS8xFvjd/2VSsYO0xxGojyvt0PA02T7ZW/Gg=; b=h6bayrCyY3WN04rD9ioYhp54C8fuEW8e3JHCdfBOwr2iHdhzW6RnmlkqfnmkLnZP3IZ4apVQDuSoBL4SF/l0lpDerJg8b8izti8avmyiokSOm0C0fSR2j4HaqOtVxuGzYCGV4HPs29IuCiQvXQ3pq7TcMxLJu0Wm7QmQ+Mty4Ew= 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 1695977831556779.8598168784325; Fri, 29 Sep 2023 01:57:11 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qm9Dm-0005JA-Br; Fri, 29 Sep 2023 04:51:38 -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 1qm9Df-0005Ch-Qe for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:31 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qm9DE-0005cb-UQ for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:30 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-63-EtKEYv2QMoaPvMUko5NqmQ-1; Fri, 29 Sep 2023 04:50:57 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B86718007A4; Fri, 29 Sep 2023 08:50:56 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 95B232026D4B; Fri, 29 Sep 2023 08:50:56 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 9D0AA21E688D; Fri, 29 Sep 2023 10:50:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695977460; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CSABX0JFS8xFvjd/2VSsYO0xxGojyvt0PA02T7ZW/Gg=; b=OAx2jZkDOBq9pc+GAFLZ6z4QQUSTOMCBxgB8S0aEobaFn5bv2mCZrv/8sVanrJHiWTYtqT 1ZczHRqMzV5b7GMdxL/W9TZn2DUvsXjilf5G7yujTsUTzTAV0FO5Hxsn8GBDwfj45Zgpmt neDWX9YMVlId3oRztvLWPQnx3JzdD/Q= X-MC-Unique: EtKEYv2QMoaPvMUko5NqmQ-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Peter Maydell Subject: [PULL 27/56] hw/core/machine: Clean up local variable shadowing Date: Fri, 29 Sep 2023 10:50:24 +0200 Message-ID: <20230929085053.2789105-28-armbru@redhat.com> In-Reply-To: <20230929085053.2789105-1-armbru@redhat.com> References: <20230929085053.2789105-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 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=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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 @redhat.com) X-ZM-MESSAGEID: 1695977833445100013 From: Philippe Mathieu-Daud=C3=A9 Fix: hw/core/machine.c: In function =E2=80=98machine_initfn=E2=80=99: hw/core/machine.c:1081:17: warning: declaration of =E2=80=98obj=E2=80=99 = shadows a parameter [-Wshadow=3Dcompatible-local] 1081 | Object *obj =3D OBJECT(ms); | ^~~ hw/core/machine.c:1065:36: note: shadowed declaration is here 1065 | static void machine_initfn(Object *obj) | ~~~~~~~~^~~ Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20230904162824.85385-2-philmd@linaro.org> Reviewed-by: Peter Maydell Signed-off-by: Markus Armbruster --- hw/core/machine.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/hw/core/machine.c b/hw/core/machine.c index cb38b8cf4c..a232ae0bcd 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -1082,8 +1082,6 @@ static void machine_initfn(Object *obj) ms->maxram_size =3D mc->default_ram_size; =20 if (mc->nvdimm_supported) { - Object *obj =3D OBJECT(ms); - ms->nvdimms_state =3D g_new0(NVDIMMState, 1); object_property_add_bool(obj, "nvdimm", machine_get_nvdimm, machine_set_nvdimm); --=20 2.41.0 From nobody Fri May 17 11:29:14 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1695977641; cv=none; d=zohomail.com; s=zohoarc; b=G6U3dU9UGWqeDQP6pu8h/xJ+CptByRhZONNwdEhN0r7VKoSpVNqZZkrlzCiEeoIwaLtdomhJsE1r9CiaX8Is/j8rnWKMqFFR+o7zE5XXDNDiS7EKa1GIrO1dYmLmitj9pmR0n+jBM3seoN2MC9dFrj5YQw3A9gKenrmdOlaMKVY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695977641; 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=PfRZm1Tr+msFGXcXQgGvHu4UGdfHaMt0ZevvgeflFQQ=; b=OAa8l2sDuwj6M4dHBPwJ8sYNsFMLQyDGbFvmoTq8jjpmt4KvzU1ZN0+JthrF/TdupYaBnG6QpIABYAOznrkDkqvoNga/PV6z5wvJd3KnkisyayY83zGiNs3OJJ7bCo5O41y8Y5VeY6tTfc/flmhcGns2tMEqx66ieh1PI4RYyME= 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 1695977641384219.6586995595767; Fri, 29 Sep 2023 01:54:01 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qm9DQ-0004zt-B4; Fri, 29 Sep 2023 04:51: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 1qm9DH-0004wc-Qk for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:08 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qm9D9-0005bP-Vz for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:07 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-534-RMuwZ1bQPsqn7-JME4WGhA-1; Fri, 29 Sep 2023 04:50:57 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D3673802D35; Fri, 29 Sep 2023 08:50:56 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B155C14171CB; Fri, 29 Sep 2023 08:50:56 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 9FE7521E6890; Fri, 29 Sep 2023 10:50:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695977459; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PfRZm1Tr+msFGXcXQgGvHu4UGdfHaMt0ZevvgeflFQQ=; b=Ajny/UbTfumUbizb8Qd1l3ALuYaNhKRY/L2ZZIgIbBt1tjpkPU7LFLJE2T7OrVNnAnw9gP Qq8mwlaIW3yx8BRTfHjdChAGEX90eXpk0DldeyOiL1FVvg4JY7ueQLn/Lnki1p44Kl7gwl Mc/Cpk46H6cA+MGFdGf7RdG+bdBWq6w= X-MC-Unique: RMuwZ1bQPsqn7-JME4WGhA-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Peter Maydell Subject: [PULL 28/56] hw/intc/openpic: Clean up local variable shadowing Date: Fri, 29 Sep 2023 10:50:25 +0200 Message-ID: <20230929085053.2789105-29-armbru@redhat.com> In-Reply-To: <20230929085053.2789105-1-armbru@redhat.com> References: <20230929085053.2789105-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 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=170.10.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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 @redhat.com) X-ZM-MESSAGEID: 1695977642353100009 From: Philippe Mathieu-Daud=C3=A9 Fix: hw/intc/openpic.c: In function =E2=80=98openpic_gbl_write=E2=80=99: hw/intc/openpic.c:614:17: warning: declaration of =E2=80=98idx=E2=80=99 s= hadows a previous local [-Wshadow=3Dcompatible-local] 614 | int idx; | ^~~ hw/intc/openpic.c:568:9: note: shadowed declaration is here 568 | int idx; | ^~~ Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20230904162824.85385-3-philmd@linaro.org> Reviewed-by: Peter Maydell Signed-off-by: Markus Armbruster --- hw/intc/openpic.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/hw/intc/openpic.c b/hw/intc/openpic.c index c757adbe53..a6f91d4bcd 100644 --- a/hw/intc/openpic.c +++ b/hw/intc/openpic.c @@ -610,11 +610,8 @@ static void openpic_gbl_write(void *opaque, hwaddr add= r, uint64_t val, case 0x10B0: case 0x10C0: case 0x10D0: - { - int idx; - idx =3D (addr - 0x10A0) >> 4; - write_IRQreg_ivpr(opp, opp->irq_ipi0 + idx, val); - } + idx =3D (addr - 0x10A0) >> 4; + write_IRQreg_ivpr(opp, opp->irq_ipi0 + idx, val); break; case 0x10E0: /* SPVE */ opp->spve =3D val & opp->vector_mask; --=20 2.41.0 From nobody Fri May 17 11:29:14 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1695977887; cv=none; d=zohomail.com; s=zohoarc; b=iXZVgTttSEjIWt2UQf/pT1/is1S2VC0tEYvUC/4+nF7eq0c/c2oZSj5sVgjPIaai27dYXgnMco4s7/oSErk+AydUMHRm9U1z8kbqScukeK/ZRNT4cflqufnKAkBieNvMHkQlq1MiIVt4V/m6KfiaLoO2VDN4ErXnsskvw84+po0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695977887; 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=3fMGsXkhh09uMBBpJC+xEyP+iGrCCOiieEQFkcxMzNs=; b=fUV145SRIIP7mRIjvcUSfrphDVdNuluY7QXmV9MGnbvYJ1w7dXJsIgx5z7ps1XAA0hwhp2r8XK3ds1OSs9N58pMuIHCBG9iJSQrwJat4Ax/J18XuEYdpWKTd49i4+UOX2mMhgY7ltXEGQqVswbn4mKbMCq0/1nmM2HhrFP/UL/8= 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 1695977887884899.537037948197; Fri, 29 Sep 2023 01:58:07 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qm9Di-0005FZ-Dd; Fri, 29 Sep 2023 04:51:34 -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 1qm9DP-0004zn-OL for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:16 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qm9DB-0005cf-Pn for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:15 -0400 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-693-g7zDFlhlMouKW483YKnsUw-1; Fri, 29 Sep 2023 04:50:57 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D67003C025CE; Fri, 29 Sep 2023 08:50:56 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B405240C6EBF; Fri, 29 Sep 2023 08:50:56 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id A2B4721E6892; Fri, 29 Sep 2023 10:50:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695977461; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3fMGsXkhh09uMBBpJC+xEyP+iGrCCOiieEQFkcxMzNs=; b=ZMFuOrcKCZ04T/6iy4+EpGAkTBeeLXEtraEpGLRrWavLzXKOl6GOdj/5hORQ4ByDK1nCdb uvUEgYqBLgJgFNmkTpcPHRzP7djiPAqhLNlNzDTUgfxheHP6pgeKemoAO2ULMewYk7usee kcn6dltaMBoll4hBS6JbDOhfj7UqbgA= X-MC-Unique: g7zDFlhlMouKW483YKnsUw-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Harsh Prateek Bora Subject: [PULL 29/56] hw/ppc: Clean up local variable shadowing in _FDT helper routine Date: Fri, 29 Sep 2023 10:50:26 +0200 Message-ID: <20230929085053.2789105-30-armbru@redhat.com> In-Reply-To: <20230929085053.2789105-1-armbru@redhat.com> References: <20230929085053.2789105-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 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=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, 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 @redhat.com) X-ZM-MESSAGEID: 1695977888974100005 From: C=C3=A9dric Le Goater this fixes numerous warnings of this type : In file included from ../hw/ppc/spapr_pci.c:43: ../hw/ppc/spapr_pci.c: In function =E2=80=98spapr_dt_phb=E2=80=99: ../include/hw/ppc/fdt.h:18:13: warning: declaration of =E2=80=98ret=E2=80= =99 shadows a previous local [-Wshadow=3Dcompatible-local] 18 | int ret =3D (exp); = \ | ^~~ ../hw/ppc/spapr_pci.c:2355:5: note: in expansion of macro =E2=80=98_FDT= =E2=80=99 2355 | _FDT(bus_off =3D fdt_add_subnode(fdt, 0, phb->dtbusname)); | ^~~~ ../hw/ppc/spapr_pci.c:2311:24: note: shadowed declaration is here 2311 | int bus_off, i, j, ret; | ^~~ Signed-off-by: C=C3=A9dric Le Goater Message-ID: <20230918145850.241074-2-clg@kaod.org> Reviewed-by: Harsh Prateek Bora Signed-off-by: Markus Armbruster --- include/hw/ppc/fdt.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/hw/ppc/fdt.h b/include/hw/ppc/fdt.h index a8cd85069f..b56ac2a8cb 100644 --- a/include/hw/ppc/fdt.h +++ b/include/hw/ppc/fdt.h @@ -15,10 +15,10 @@ =20 #define _FDT(exp) \ do { \ - int ret =3D (exp); \ - if (ret < 0) { \ - error_report("error creating device tree: %s: %s", \ - #exp, fdt_strerror(ret)); \ + int _ret =3D (exp); \ + if (_ret < 0) { \ + error_report("error creating device tree: %s: %s", \ + #exp, fdt_strerror(_ret)); \ exit(1); \ } \ } while (0) --=20 2.41.0 From nobody Fri May 17 11:29:14 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1695977873; cv=none; d=zohomail.com; s=zohoarc; b=laARTU6IP+XFM7WRJXSTm0DLE5ecVNWHWhLFe/rGRxsZYk/c6xInJeStMNA/Lol1X6qwgbZF5pEnWM+ywDTWcYZcWlN1mUokHUOF65tsCnuq4hMj0pK//CwXEr4DmTEsW3q6KGnWudqSbXRgSC9MyhGQUnXOnlrCVQENwe2g3YI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695977873; 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=P70bHM5/faSmZvmFMecysev/ZsN9wiRLMg1QC5BYcAw=; b=kVcvqs1P2fseNiB7e/Kq93ZrAGBbXlfKvj0XPu0OdpH8UAOy8JFCTH2QOYOG2mkV2F461Y3T4R0FFcekkWmWNGkSgwx1n/UFrhjp+sYwzV0veSe8Xh1/8mn5NUs2oz/WYBsE0qaVYSxbpwgomnvjaU7RF4bsRWBvDxjj24vuGfA= 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 1695977873139779.1026417852719; Fri, 29 Sep 2023 01:57:53 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qm9DX-00055h-F1; Fri, 29 Sep 2023 04:51:23 -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 1qm9DJ-0004x9-1x for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:10 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qm9DA-0005bX-6x for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:08 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-534-tg8g7DhiOFGxPWZ4RzGbJA-1; Fri, 29 Sep 2023 04:50:57 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E22B3811E8D; Fri, 29 Sep 2023 08:50:56 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BF744492C37; Fri, 29 Sep 2023 08:50:56 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id A572021E6893; Fri, 29 Sep 2023 10:50:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695977459; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=P70bHM5/faSmZvmFMecysev/ZsN9wiRLMg1QC5BYcAw=; b=XYXmItpHZTOrnf4Kn7Rs4q4YoUY+OYA//GOX6f6xCMHhaE2S0QoomUPjXK8KKgLjWnRKAO OqEstJqL07nF+Kjeqb56+z6OmkIvZFGnIb7HCjKv8UGzxKht9ZwhmY1AoEI5IN+tqcwE8s xbGH9CZsTujcC8DCrznskPIkWUDyWws= X-MC-Unique: tg8g7DhiOFGxPWZ4RzGbJA-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Harsh Prateek Bora Subject: [PULL 30/56] pnv/psi: Clean up local variable shadowing Date: Fri, 29 Sep 2023 10:50:27 +0200 Message-ID: <20230929085053.2789105-31-armbru@redhat.com> In-Reply-To: <20230929085053.2789105-1-armbru@redhat.com> References: <20230929085053.2789105-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 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=170.10.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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 @redhat.com) X-ZM-MESSAGEID: 1695977873596100009 From: C=C3=A9dric Le Goater to fix : ../hw/ppc/pnv_psi.c: In function =E2=80=98pnv_psi_p9_mmio_write=E2=80=99: ../hw/ppc/pnv_psi.c:741:24: warning: declaration of =E2=80=98addr=E2=80= =99 shadows a parameter [-Wshadow=3Dcompatible-local] 741 | hwaddr addr =3D val & ~(PSIHB9_ESB_CI_VALID | PSI= HB10_ESB_CI_64K); | ^~~~ ../hw/ppc/pnv_psi.c:702:56: note: shadowed declaration is here 702 | static void pnv_psi_p9_mmio_write(void *opaque, hwaddr addr, | ~~~~~~~^~~~ Signed-off-by: C=C3=A9dric Le Goater Message-ID: <20230918145850.241074-3-clg@kaod.org> Reviewed-by: Harsh Prateek Bora Signed-off-by: Markus Armbruster --- hw/ppc/pnv_psi.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/ppc/pnv_psi.c b/hw/ppc/pnv_psi.c index daaa2f0575..26460d210d 100644 --- a/hw/ppc/pnv_psi.c +++ b/hw/ppc/pnv_psi.c @@ -738,8 +738,9 @@ static void pnv_psi_p9_mmio_write(void *opaque, hwaddr = addr, } } else { if (!(psi->regs[reg] & PSIHB9_ESB_CI_VALID)) { - hwaddr addr =3D val & ~(PSIHB9_ESB_CI_VALID | PSIHB10_ESB_= CI_64K); - memory_region_add_subregion(sysmem, addr, + hwaddr esb_addr =3D + val & ~(PSIHB9_ESB_CI_VALID | PSIHB10_ESB_CI_64K); + memory_region_add_subregion(sysmem, esb_addr, &psi9->source.esb_mmio); } } --=20 2.41.0 From nobody Fri May 17 11:29:14 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1695977536; cv=none; d=zohomail.com; s=zohoarc; b=dvJEdzSewLWEGnAPhAQQEUhLhXEqJ3JDUhrKJLVYKCDeta3peQt/wOHDjms5lRJpm1J4hhZMrkvfNf/oF50f+yG+DS1kp9FaaRC9CSTPmzJvyDQzZaQdKFk/tLHItDEcVIoVxDNASXS5H93arKsaq1rB671G+E+BOqf3fGhNCCU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695977536; 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=rRwR21bdggz4SmTbbLuneB2b/ji31PDEjZ9aJRmNc6M=; b=fRfRsgOmpw6MbvlPwJphxELnwe5yVEWdCeV1jUSkgNHFJz0UK3X1XhMWRXjB6oSSNfpVefLdkl7tjcQrCthsvm0v58oFm8QKTunpHChGwn5ksncvy4XUwWPhTMug6aDG94umn+06tc+URV5x4It22gdDC84wbgSFx5EW89oWhvA= 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 1695977536173853.3449815412173; Fri, 29 Sep 2023 01:52:16 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qm9Da-00059r-BJ; Fri, 29 Sep 2023 04:51:26 -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 1qm9DV-000521-Kv for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:21 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qm9DC-0005cc-LA for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:21 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-472-yYV9XF5BPLWSvNyhxBhKCQ-1; Fri, 29 Sep 2023 04:50:57 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 04F66185A79C; Fri, 29 Sep 2023 08:50:57 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D6305C15BB8; Fri, 29 Sep 2023 08:50:56 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id A853D21E6894; Fri, 29 Sep 2023 10:50:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695977460; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rRwR21bdggz4SmTbbLuneB2b/ji31PDEjZ9aJRmNc6M=; b=AzSqjx3H5yPs8YbPZha7F1Owmba3sli0+WQRqpkPZiG2Z8at0E6oNlOc4iXlmiNqsyLEa0 Rl8uYN4wdj9y7eugKyE+wxHl1xgghdrffJyQYMFHmrt+YRtCvU5DSf8KEEHMzkBvPZTJxP 1twI4XP2qIxrM+W5bmEojpK/A3RC6DI= X-MC-Unique: yYV9XF5BPLWSvNyhxBhKCQ-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Harsh Prateek Bora Subject: [PULL 31/56] spapr: Clean up local variable shadowing in spapr_dt_cpus() Date: Fri, 29 Sep 2023 10:50:28 +0200 Message-ID: <20230929085053.2789105-32-armbru@redhat.com> In-Reply-To: <20230929085053.2789105-1-armbru@redhat.com> References: <20230929085053.2789105-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 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=170.10.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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 @redhat.com) X-ZM-MESSAGEID: 1695977536516100003 From: C=C3=A9dric Le Goater Introduce a helper routine defining one CPU device node to fix this warning : ../hw/ppc/spapr.c: In function =E2=80=98spapr_dt_cpus=E2=80=99: ../hw/ppc/spapr.c:812:19: warning: declaration of =E2=80=98cs=E2=80=99 sh= adows a previous local [-Wshadow=3Dcompatible-local] 812 | CPUState *cs =3D rev[i]; | ^~ ../hw/ppc/spapr.c:786:15: note: shadowed declaration is here 786 | CPUState *cs; | ^~ Signed-off-by: C=C3=A9dric Le Goater Message-ID: <20230918145850.241074-4-clg@kaod.org> Reviewed-by: Harsh Prateek Bora Signed-off-by: Markus Armbruster --- hw/ppc/spapr.c | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 1f1aa2a6d4..612dbdf356 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -780,6 +780,26 @@ static void spapr_dt_cpu(CPUState *cs, void *fdt, int = offset, pcc->lrg_decr_bits))); } =20 +static void spapr_dt_one_cpu(void *fdt, SpaprMachineState *spapr, CPUState= *cs, + int cpus_offset) +{ + PowerPCCPU *cpu =3D POWERPC_CPU(cs); + int index =3D spapr_get_vcpu_id(cpu); + DeviceClass *dc =3D DEVICE_GET_CLASS(cs); + g_autofree char *nodename =3D NULL; + int offset; + + if (!spapr_is_thread0_in_vcore(spapr, cpu)) { + return; + } + + nodename =3D g_strdup_printf("%s@%x", dc->fw_name, index); + offset =3D fdt_add_subnode(fdt, cpus_offset, nodename); + _FDT(offset); + spapr_dt_cpu(cs, fdt, offset, spapr); +} + + static void spapr_dt_cpus(void *fdt, SpaprMachineState *spapr) { CPUState **rev; @@ -809,21 +829,7 @@ static void spapr_dt_cpus(void *fdt, SpaprMachineState= *spapr) } =20 for (i =3D n_cpus - 1; i >=3D 0; i--) { - CPUState *cs =3D rev[i]; - PowerPCCPU *cpu =3D POWERPC_CPU(cs); - int index =3D spapr_get_vcpu_id(cpu); - DeviceClass *dc =3D DEVICE_GET_CLASS(cs); - g_autofree char *nodename =3D NULL; - int offset; - - if (!spapr_is_thread0_in_vcore(spapr, cpu)) { - continue; - } - - nodename =3D g_strdup_printf("%s@%x", dc->fw_name, index); - offset =3D fdt_add_subnode(fdt, cpus_offset, nodename); - _FDT(offset); - spapr_dt_cpu(cs, fdt, offset, spapr); + spapr_dt_one_cpu(fdt, spapr, rev[i], cpus_offset); } =20 g_free(rev); --=20 2.41.0 From nobody Fri May 17 11:29:14 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1695977702; cv=none; d=zohomail.com; s=zohoarc; b=Z6LbohXX8o8bvXhPo8IH6g6OyZPGGijNQvYdO6WuEFqVN0BqMUldoPvn/g4+4kEN1dfD0bgfJVuIRQLEGOf+tWBlu72qe1xIDejxzhwRuf7Vh4RDVq1lKvEkXCL4DHXdoPGB6NFDeojxEluDEVaIkYZ6aMxXFjeN3QU1fA4u4zs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695977702; 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=0JvEG4SigdjbPHe789wgUjVVzwqke2C3K/FtQAM2hp8=; b=WFwjcg40ngv+XEdvSsXgXW0SA1fnTEf26AmhC7d6bu7Amgf3sD7kSRd6bPwF/VgIBhJnWcXhoPWj4ulJ63oWBMvPX0xgR12vuC8pXxmokl2urF8WyLITJ04GE8Ukhqi122eiAHssmrgF6XW8nZ00D5Az3e9TOG8S7GOHLI6mUH0= 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 169597770224434.65809091993742; Fri, 29 Sep 2023 01:55:02 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qm9Dc-0005Br-KF; Fri, 29 Sep 2023 04:51:28 -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 1qm9DO-0004zc-JB for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:14 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qm9DA-0005ba-Ej for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:14 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-563-d1wyyFzbPxGVNoTc4eJ_-w-1; Fri, 29 Sep 2023 04:50:57 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 07D48805B32; Fri, 29 Sep 2023 08:50:57 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DA31A40C2064; Fri, 29 Sep 2023 08:50:56 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id AB28221E6895; Fri, 29 Sep 2023 10:50:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695977459; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0JvEG4SigdjbPHe789wgUjVVzwqke2C3K/FtQAM2hp8=; b=OMRnVEp41Sr/zIyq0Gdjp5mR7SzDbU+phpl2qQ30cVtyGNqNjbgDfs/SfHADp+KgZdqKbV tBjlilGC0Z8YmdvffLksosWZ70ofNxDodVWsAz9kOUT/pNoqA8pgxrPN1RIGMdrzZI3nA2 PJRU6/iKNCHMjRsuNl/W5+q4B8nxaF0= X-MC-Unique: d1wyyFzbPxGVNoTc4eJ_-w-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Harsh Prateek Bora Subject: [PULL 32/56] spapr: Clean up local variable shadowing in spapr_init_cpus() Date: Fri, 29 Sep 2023 10:50:29 +0200 Message-ID: <20230929085053.2789105-33-armbru@redhat.com> In-Reply-To: <20230929085053.2789105-1-armbru@redhat.com> References: <20230929085053.2789105-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 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=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, T_SPF_TEMPERROR=0.01 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 @redhat.com) X-ZM-MESSAGEID: 1695977703442100003 From: C=C3=A9dric Le Goater Remove extra 'i' variable to fix this warning : ../hw/ppc/spapr.c: In function =E2=80=98spapr_init_cpus=E2=80=99: ../hw/ppc/spapr.c:2668:13: warning: declaration of =E2=80=98i=E2=80=99 sh= adows a previous local [-Wshadow=3Dcompatible-local] 2668 | int i; | ^ ../hw/ppc/spapr.c:2645:9: note: shadowed declaration is here 2645 | int i; | ^ Signed-off-by: C=C3=A9dric Le Goater Message-ID: <20230918145850.241074-5-clg@kaod.org> Reviewed-by: Harsh Prateek Bora Signed-off-by: Markus Armbruster --- hw/ppc/spapr.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 612dbdf356..4fe82e490a 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -2665,8 +2665,6 @@ static void spapr_init_cpus(SpaprMachineState *spapr) } =20 if (smc->pre_2_10_has_unused_icps) { - int i; - for (i =3D 0; i < spapr_max_server_number(spapr); i++) { /* Dummy entries get deregistered when real ICPState objects * are registered during CPU core hotplug. --=20 2.41.0 From nobody Fri May 17 11:29:14 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1695977831; cv=none; d=zohomail.com; s=zohoarc; b=gfctBzs76JlofHtRuCA1uk7uzNFLrPBfaL48pn4veoPohwUDUaDVRlcZm1P8R0WINKrL2TCaKR6ERUZ8U9aoBGLGYDkh27WHpStAejvLD0K+MVPiUTnnIOoexlOE+H7VzwemGGnx82en2hMhLdRj//3jgPZ6dJmciFmBxj+lRhI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695977831; 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=iFHXkfu0fole/oqJ653QsQLZi9wEuEiSH8oaSnTRrOg=; b=kAA2tzf+qOKgeu3lshTu9Kt1PzFL8y5QV8BYuj9HEILHkbnJ4Y2UotlO3YozW5vTUuDVE81yF1tLzQNEk8fPADmXYRfQ3oHb686/At8aFkq0ZG6vuP9FH4B0UehelLdvDQBGfms4JwqLTVlvcKI3y1cXTiHy4/lLumnbRbtEa0w= 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 169597783122539.82181501334833; Fri, 29 Sep 2023 01:57:11 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qm9Dg-0005ES-Cj; Fri, 29 Sep 2023 04:51:32 -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 1qm9DW-00053S-Lk for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:22 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qm9DC-0005cY-NF for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:22 -0400 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-563-FVoHJYMINfa81ftQFX_kPA-1; Fri, 29 Sep 2023 04:50:57 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0DB37380117D; Fri, 29 Sep 2023 08:50:57 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DED342026D4B; Fri, 29 Sep 2023 08:50:56 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id B248E21E6896; Fri, 29 Sep 2023 10:50:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695977460; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iFHXkfu0fole/oqJ653QsQLZi9wEuEiSH8oaSnTRrOg=; b=VUGugXPfwq1rMcKLIPW8EdZTpvQaQ7/3KSflaFMveUZD4viSf9fBfrpnmWqqMoHAdNS3U9 /JWYimaMn9rUUwhLudqQlfIeRM3rfYuT5tAhLpr1fTJH1GqDSy25i3qM/iSLASr3UWoADs cgrSUJJpam1aRVpaDFK9WImuWW0m9w0= X-MC-Unique: FVoHJYMINfa81ftQFX_kPA-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 33/56] spapr: Clean up local variable shadowing in spapr_get_fw_dev_path() Date: Fri, 29 Sep 2023 10:50:30 +0200 Message-ID: <20230929085053.2789105-34-armbru@redhat.com> In-Reply-To: <20230929085053.2789105-1-armbru@redhat.com> References: <20230929085053.2789105-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 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=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, 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 @redhat.com) X-ZM-MESSAGEID: 1695977831439100005 From: C=C3=A9dric Le Goater Rename PCIDevice variable to avoid this warning : ../hw/ppc/spapr.c: In function =E2=80=98spapr_get_fw_dev_path=E2=80=99: ../hw/ppc/spapr.c:3217:20: warning: declaration of =E2=80=98pcidev=E2=80= =99 shadows a previous local [-Wshadow=3Dcompatible-local] 3217 | PCIDevice *pcidev =3D CAST(PCIDevice, dev, TYPE_PCI_DEVIC= E); | ^~~~~~ ../hw/ppc/spapr.c:3147:16: note: shadowed declaration is here 3147 | PCIDevice *pcidev =3D CAST(PCIDevice, dev, TYPE_PCI_DEVICE); | ^~~~~~ Signed-off-by: C=C3=A9dric Le Goater Message-ID: <20230918145850.241074-6-clg@kaod.org> Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Markus Armbruster --- hw/ppc/spapr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 4fe82e490a..d4230d3647 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -3214,8 +3214,8 @@ static char *spapr_get_fw_dev_path(FWPathProvider *p,= BusState *bus, =20 if (g_str_equal("pci-bridge", qdev_fw_name(dev))) { /* SLOF uses "pci" instead of "pci-bridge" for PCI bridges */ - PCIDevice *pcidev =3D CAST(PCIDevice, dev, TYPE_PCI_DEVICE); - return g_strdup_printf("pci@%x", PCI_SLOT(pcidev->devfn)); + PCIDevice *pdev =3D CAST(PCIDevice, dev, TYPE_PCI_DEVICE); + return g_strdup_printf("pci@%x", PCI_SLOT(pdev->devfn)); } =20 if (pcidev) { --=20 2.41.0 From nobody Fri May 17 11:29:14 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1695977911; cv=none; d=zohomail.com; s=zohoarc; b=cqp8rr15PGz3h/isDIirYqAazDvtIjJUMHDsnjCV+RovTBOSuYUSdJbYCCYM6+dxlOsErSKowsdPIPSYlGB0ILSTvvDVMMQdFaoyAhtfcW4bDJ5blZtS5uDIoAY3W97U4pYJfSKjCDWHo+/vfVmkWjGuzWECwKkWeY677knRPg4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695977911; 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=jQvEnCBkMaIjlkhN0qqXFYk8x9asIDFQ7pHQfyuffOU=; b=LwILWck/00qjyRjkL1SNNvLNOGcBeWTlRMINcpai+9IsWp5E0klI9qfpmAIr3ibVPyBGy3IOZPKDX7hSPRwP+VCt4dyDw6DG8runo5ZdBiYTWrEn/f+FniAGli8St22Isys9/yClMaSE8b6eAf2olYH31VgSK1oqmSwGaAPVU38= 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 1695977911586793.9284958769964; Fri, 29 Sep 2023 01:58:31 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qm9Dg-0005Ez-Qp; Fri, 29 Sep 2023 04:51:33 -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 1qm9DY-00057S-Mf for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:24 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qm9DD-0005dp-03 for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:24 -0400 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-693-nYKA9oSrMGGF1uM4Dw7IgQ-1; Fri, 29 Sep 2023 04:50:57 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0D19D3801179; Fri, 29 Sep 2023 08:50:57 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DF88C40C2070; Fri, 29 Sep 2023 08:50:56 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id B767C21E6897; Fri, 29 Sep 2023 10:50:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695977462; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jQvEnCBkMaIjlkhN0qqXFYk8x9asIDFQ7pHQfyuffOU=; b=ghZPVcaYHzg03WROxIztqRs/dD6AiqSI1yb/JtVR71Bv0T5J0VmRBcSHGCm/qXBJXeSg8E WYanBed3wx7YFO9L0YoD5qlDx4uVfTKbETdNDBToM8cJ4VCFiN3cadx+ao5dpEJAgfmK5E OWcNM+TI+TERP2su1afsHbbwLfFjwf8= X-MC-Unique: nYKA9oSrMGGF1uM4Dw7IgQ-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Harsh Prateek Bora Subject: [PULL 34/56] spapr/drc: Clean up local variable shadowing in rtas_ibm_configure_connector() Date: Fri, 29 Sep 2023 10:50:31 +0200 Message-ID: <20230929085053.2789105-35-armbru@redhat.com> In-Reply-To: <20230929085053.2789105-1-armbru@redhat.com> References: <20230929085053.2789105-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 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=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, 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 @redhat.com) X-ZM-MESSAGEID: 1695977913420100005 From: C=C3=A9dric Le Goater Remove extra 'drc_index' variable to avoid this warning : ../hw/ppc/spapr_drc.c: In function =E2=80=98rtas_ibm_configure_connector= =E2=80=99: ../hw/ppc/spapr_drc.c:1240:26: warning: declaration of =E2=80=98drc_index= =E2=80=99 shadows a previous local [-Wshadow=3Dcompatible-local] 1240 | uint32_t drc_index =3D spapr_drc_index(drc); | ^~~~~~~~~ ../hw/ppc/spapr_drc.c:1155:14: note: shadowed declaration is here 1155 | uint32_t drc_index; | ^~~~~~~~~ Signed-off-by: C=C3=A9dric Le Goater Message-ID: <20230918145850.241074-7-clg@kaod.org> Reviewed-by: Harsh Prateek Bora Signed-off-by: Markus Armbruster --- hw/ppc/spapr_drc.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/hw/ppc/spapr_drc.c b/hw/ppc/spapr_drc.c index b5c400a94d..843e318312 100644 --- a/hw/ppc/spapr_drc.c +++ b/hw/ppc/spapr_drc.c @@ -1237,8 +1237,6 @@ static void rtas_ibm_configure_connector(PowerPCCPU *= cpu, case FDT_END_NODE: drc->ccs_depth--; if (drc->ccs_depth =3D=3D 0) { - uint32_t drc_index =3D spapr_drc_index(drc); - /* done sending the device tree, move to configured state = */ trace_spapr_drc_set_configured(drc_index); drc->state =3D drck->ready_state; --=20 2.41.0 From nobody Fri May 17 11:29:14 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1695977911; cv=none; d=zohomail.com; s=zohoarc; b=GprOsvC6+tQlV8F0O8pOCoWcs2DAgYYV7RUkToM93tYG184/gliEEmOyCBgw4RUGMNT+eg+FmDm7a5a8A3K47q7oZ4dCA5k9esTdeAPIEhfGI9JZGcTJ7L3R2h+tTrutzHewFoiPzQc43agXIsg8AMNTejZdYoizS+YlTpF8Ivc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695977911; 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=DZX1t/Jy77h1aaNiB67Wo1f3gwNo9ouNMgM0TJJqWAw=; b=gpuU2d3/6m2xGxoEHSPJF1l7BwOnem7oIvzh3xl34W10nhDnANfaw+w2s/ibqgWtrHLA5lMHHn+p80RikpLGpJrLUzDRSxQjbkm+M453BM3VPlzXY31OKzQpCiEIFYiOwutJtDFjbTQW+xVWZ5L+phIxl+/zXBtFAMJxVTzMnjA= 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 1695977911711421.2194518546195; Fri, 29 Sep 2023 01:58:31 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qm9Dp-0005Kn-2F; Fri, 29 Sep 2023 04:51:41 -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 1qm9Dj-0005Gu-6t for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:35 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qm9DE-0005dW-Tk for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:33 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-563-k3xIZ4BfNlqkmfobvO0aPg-1; Fri, 29 Sep 2023 04:50:57 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8E7E5858F19; Fri, 29 Sep 2023 08:50:57 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6B6E02026D68; Fri, 29 Sep 2023 08:50:57 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id BA63A21E6898; Fri, 29 Sep 2023 10:50:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695977461; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DZX1t/Jy77h1aaNiB67Wo1f3gwNo9ouNMgM0TJJqWAw=; b=XmutOjIVzuZw1URAAhqQnOPgLZxa/TBNX4whODBgW0ZLQne5J7Z1VtlwfBqtyfwWMw9kTY 5SKKt8s0tNmIkPwaBilIH659qCwWlwzviiAuw3bQwsj9Od0W8FuAaljBXyxqgaQ3Bm75uc ZwG6Ap/TFBvv2wMcj9aMShIcKXOXVpc= X-MC-Unique: k3xIZ4BfNlqkmfobvO0aPg-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Harsh Prateek Bora Subject: [PULL 35/56] spapr/pci: Clean up local variable shadowing in spapr_phb_realize() Date: Fri, 29 Sep 2023 10:50:32 +0200 Message-ID: <20230929085053.2789105-36-armbru@redhat.com> In-Reply-To: <20230929085053.2789105-1-armbru@redhat.com> References: <20230929085053.2789105-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 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=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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 @redhat.com) X-ZM-MESSAGEID: 1695977913246100003 From: C=C3=A9dric Le Goater Rename SysBusDevice variable to avoid this warning : ../hw/ppc/spapr_pci.c: In function =E2=80=98spapr_phb_realize=E2=80=99: ../hw/ppc/spapr_pci.c:1872:24: warning: declaration of =E2=80=98s=E2=80= =99 shadows a previous local [-Wshadow=3Dlocal] 1872 | SpaprPhbState *s; | ^ ../hw/ppc/spapr_pci.c:1829:19: note: shadowed declaration is here 1829 | SysBusDevice *s =3D SYS_BUS_DEVICE(dev); | ^ Signed-off-by: C=C3=A9dric Le Goater Message-ID: <20230918145850.241074-8-clg@kaod.org> Reviewed-by: Harsh Prateek Bora Signed-off-by: Markus Armbruster --- hw/ppc/spapr_pci.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c index ce14959317..370c5a90f2 100644 --- a/hw/ppc/spapr_pci.c +++ b/hw/ppc/spapr_pci.c @@ -1826,9 +1826,9 @@ static void spapr_phb_realize(DeviceState *dev, Error= **errp) (SpaprMachineState *) object_dynamic_cast(qdev_get_machine(), TYPE_SPAPR_MACHINE); SpaprMachineClass *smc =3D spapr ? SPAPR_MACHINE_GET_CLASS(spapr) : NU= LL; - SysBusDevice *s =3D SYS_BUS_DEVICE(dev); - SpaprPhbState *sphb =3D SPAPR_PCI_HOST_BRIDGE(s); - PCIHostState *phb =3D PCI_HOST_BRIDGE(s); + SysBusDevice *sbd =3D SYS_BUS_DEVICE(dev); + SpaprPhbState *sphb =3D SPAPR_PCI_HOST_BRIDGE(sbd); + PCIHostState *phb =3D PCI_HOST_BRIDGE(sbd); MachineState *ms =3D MACHINE(spapr); char *namebuf; int i; --=20 2.41.0 From nobody Fri May 17 11:29:14 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1695977837; cv=none; d=zohomail.com; s=zohoarc; b=HKE3qBYxZaQpmUqSY5/lqDsRsNY2B3HLaT0Zialqb07dvb5Ca4+kjRxprD22DhC0Yh2MIGPrf2g3T0W3I5mPRgCJYADkYHZT9CvpVDleo6j6RiQzx6Rrg/LTFqIYzx9IyLv2Kph8hWOBtq44YLoFJy+PvBo3EAZ8MTpsPv/VdA8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695977837; 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=o5rfn6Asg21XhrzZfBCY3GYKV0hmgXGMupa9rdBuXxo=; b=JAvrym5b14NaLtkTYtasHf6XkJCLg30f7aTGRMSPatutz1ciVNwukhnwnCl6ISRQfZwa2QL3x1J5t0BnMjfz6ZCaP1YB8YCnIEUaOuXObCSqvDl5YXwrwmyMUxgehxkl5DXHY/Ia/Ppay/GieDyueg81cPEprbHlOhZVyvLc2UI= 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 16959778372851020.0995485262654; Fri, 29 Sep 2023 01:57:17 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qm9Di-0005FO-3g; Fri, 29 Sep 2023 04:51:35 -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 1qm9DW-00053o-VE for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:23 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qm9DC-0005dZ-PB for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:22 -0400 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-474-V1oPfnATNM2MnCvmCcU39w-1; Fri, 29 Sep 2023 04:50:58 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9680C29AB45F; Fri, 29 Sep 2023 08:50:57 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 72D30492C37; Fri, 29 Sep 2023 08:50:57 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id BD4FC21E6899; Fri, 29 Sep 2023 10:50:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695977461; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=o5rfn6Asg21XhrzZfBCY3GYKV0hmgXGMupa9rdBuXxo=; b=jPK3dUmUgUN+vdVh/8Jy5ASO6RvW9FP1jAi/RwV51XKOdd74ow9GZv2MBgOf6It8Pz+Uxe sIZihCIp+FMPJpEQ3Oez3Vff4xPJsNxtSFdEyiD7rkPnL6TQI+u5h3PFFqOniy9p2NrfP1 tqnLCtJEZOZogLuhvl5hCV91PtOok60= X-MC-Unique: V1oPfnATNM2MnCvmCcU39w-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Harsh Prateek Bora Subject: [PULL 36/56] spapr/drc: Clean up local variable shadowing in prop_get_fdt() Date: Fri, 29 Sep 2023 10:50:33 +0200 Message-ID: <20230929085053.2789105-37-armbru@redhat.com> In-Reply-To: <20230929085053.2789105-1-armbru@redhat.com> References: <20230929085053.2789105-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 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=170.10.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, 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 @redhat.com) X-ZM-MESSAGEID: 1695977837958100001 From: C=C3=A9dric Le Goater Rename 'name' variable to avoid this warning : ../hw/ppc/spapr_drc.c: In function =E2=80=98prop_get_fdt=E2=80=99: ../hw/ppc/spapr_drc.c:344:21: warning: declaration of =E2=80=98name=E2=80= =99 shadows a parameter [-Wshadow=3Dcompatible-local] 344 | const char *name =3D NULL; | ^~~~ ../hw/ppc/spapr_drc.c:325:63: note: shadowed declaration is here 325 | static void prop_get_fdt(Object *obj, Visitor *v, const char *nam= e, | ~~~~~~~~~~~~^~~~ Signed-off-by: C=C3=A9dric Le Goater Message-ID: <20230918145850.241074-9-clg@kaod.org> Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Harsh Prateek Bora Signed-off-by: Markus Armbruster --- hw/ppc/spapr_drc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/ppc/spapr_drc.c b/hw/ppc/spapr_drc.c index 843e318312..2b99d3b4b1 100644 --- a/hw/ppc/spapr_drc.c +++ b/hw/ppc/spapr_drc.c @@ -341,7 +341,7 @@ static void prop_get_fdt(Object *obj, Visitor *v, const= char *name, fdt_depth =3D 0; =20 do { - const char *name =3D NULL; + const char *dt_name =3D NULL; const struct fdt_property *prop =3D NULL; int prop_len =3D 0, name_len =3D 0; uint32_t tag; @@ -351,8 +351,8 @@ static void prop_get_fdt(Object *obj, Visitor *v, const= char *name, switch (tag) { case FDT_BEGIN_NODE: fdt_depth++; - name =3D fdt_get_name(fdt, fdt_offset, &name_len); - if (!visit_start_struct(v, name, NULL, 0, errp)) { + dt_name =3D fdt_get_name(fdt, fdt_offset, &name_len); + if (!visit_start_struct(v, dt_name, NULL, 0, errp)) { return; } break; @@ -369,8 +369,8 @@ static void prop_get_fdt(Object *obj, Visitor *v, const= char *name, case FDT_PROP: { int i; prop =3D fdt_get_property_by_offset(fdt, fdt_offset, &prop_len= ); - name =3D fdt_string(fdt, fdt32_to_cpu(prop->nameoff)); - if (!visit_start_list(v, name, NULL, 0, errp)) { + dt_name =3D fdt_string(fdt, fdt32_to_cpu(prop->nameoff)); + if (!visit_start_list(v, dt_name, NULL, 0, errp)) { return; } for (i =3D 0; i < prop_len; i++) { --=20 2.41.0 From nobody Fri May 17 11:29:14 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1695977548; cv=none; d=zohomail.com; s=zohoarc; b=B21x5Rexr05KUnnUg5dOOfZa+gx4ce7hC73RM4Cikv+ApwX1YBRGAhqyTEeVx7xpT6xW8/WN0cDzVBwrWn2tzIoCAwv8GoG2iB9+h9/vZLRBqtkNgKJQhzl33YVJuwim3e7MeNBjBf2tMpsvNPL+hFOr2EPFXsubMLKQHO2StnI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695977548; 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=VvvGXkXrrd0l0DwfoPXaPXtY8kHdAwKKe8EpFZMipSY=; b=UzeJ1uq29j7cXq7Cq+70V+va0fw47BNjyd1loSDo4fp5ZwDlXk8575lpCc8u46jReH1YHw2XNUFX9XYqrK4oSB2oAAtTlJ/Z4NvHXF+pB/OCi/OzQeclymDBxCUUgkFlyI2o5f4qFsLpx/nxFrdQOLu2hhME/ZAlwfYMV7ITNv4= 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 1695977548581183.52236731295466; Fri, 29 Sep 2023 01:52:28 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qm9E9-0005TA-Bd; Fri, 29 Sep 2023 04:52:03 -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 1qm9Dj-0005HE-CF for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:35 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qm9DE-0005e4-Sz for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:35 -0400 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-37-FwzS-NwEPQOYYVd_26KPzQ-1; Fri, 29 Sep 2023 04:50:58 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8304129AA3B9; Fri, 29 Sep 2023 08:50:58 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 607A32026D4B; Fri, 29 Sep 2023 08:50:57 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id C004421E689A; Fri, 29 Sep 2023 10:50:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695977462; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VvvGXkXrrd0l0DwfoPXaPXtY8kHdAwKKe8EpFZMipSY=; b=AX8ODjVN9oSBCrwhAkOttdspeGqzQbRdDe4aZK32Way2KGKCZrVU0+jcVqmOiicuODPZP/ QXWbiUJLRx/IHHVelajaUL5HHxLS8mmjMKseaul2JWduFvkXHjSzZNDfqXhBdM5pigr5Qt ltdxcV0eErJW5ZBv8ZDo7lIDRyakHfs= X-MC-Unique: FwzS-NwEPQOYYVd_26KPzQ-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, Alberto Garcia Subject: [PULL 37/56] test-throttle: don't shadow 'index' variable in do_test_accounting() Date: Fri, 29 Sep 2023 10:50:34 +0200 Message-ID: <20230929085053.2789105-38-armbru@redhat.com> In-Reply-To: <20230929085053.2789105-1-armbru@redhat.com> References: <20230929085053.2789105-1-armbru@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 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=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, 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 @redhat.com) X-ZM-MESSAGEID: 1695977550072100001 Content-Type: text/plain; charset="utf-8" From: Alberto Garcia Fixes build with -Wshadow=3Dlocal Signed-off-by: Alberto Garcia Message-ID: <20230922105742.81317-1-berto@igalia.com> Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster --- tests/unit/test-throttle.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/test-throttle.c b/tests/unit/test-throttle.c index cb587e33e7..ac35d65d19 100644 --- a/tests/unit/test-throttle.c +++ b/tests/unit/test-throttle.c @@ -625,7 +625,7 @@ static bool do_test_accounting(bool is_ops, /* are we t= esting bps or ops */ throttle_config_init(&cfg); =20 for (i =3D 0; i < 3; i++) { - BucketType index =3D to_test[is_ops][i]; + index =3D to_test[is_ops][i]; cfg.buckets[index].avg =3D avg; } =20 --=20 2.41.0 From nobody Fri May 17 11:29:14 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1695977778; cv=none; d=zohomail.com; s=zohoarc; b=a1twX5HBS/36hvs174nE48NzKGBkp6iF4e7dpE5jJ8HUxoNBWvXo4uBNEHaCGaAaZBYnE+lVvlZkES5vZctBuhRZRMUXoHkmyVuulEQz9rKXivFC96onU7+CTueh7fLKhYydofwNVUw2WCQ8z8eJnpOlq3VeEm1zUTWcfSBUv7I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695977778; 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=lGiKOv060cQANUItZbv+wuoAJ5NzveoKqVEzBRGLyno=; b=ahG3dPidJa5R6CglVRxFV4HXcPh+FXUJR7wdyMI5+Yc3WdUpXIVayXlQduZ1DqIdwGa0/Bku9GbYPBjp+YNm9GXdooRNnkO1XLZKEy5WRjAL3MixjzjngGQ2GApdR6g4zr1zhDcIeLfKxfxcgGucb0blxy4LMitzx2OF4tU/qKs= 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 1695977778102418.4716047650876; Fri, 29 Sep 2023 01:56:18 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qm9Db-0005Al-1T; Fri, 29 Sep 2023 04:51:27 -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 1qm9DY-00057a-NY for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:24 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qm9DC-0005dk-SH for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:24 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-29-42pUnnrRNhyPTfH7Iinkxw-1; Fri, 29 Sep 2023 04:50:58 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B92E5101AA6D; Fri, 29 Sep 2023 08:50:57 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7A7A110F1BE7; Fri, 29 Sep 2023 08:50:57 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id C2ED421E689B; Fri, 29 Sep 2023 10:50:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695977462; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lGiKOv060cQANUItZbv+wuoAJ5NzveoKqVEzBRGLyno=; b=i/wn0Nk50/HHiAMYhS4DlxjjdaNKYa9HuwurqwnlI0pSWfzCHbZV8y+gwgEeOStrmDqW8l ulw+RXuEEFI6WJKu1jXkmrKcLgSNpGyVcncrRMUmXyybQAm8eULWO+/+rkGDpxAt+IJOpf t8QmLWHWnquvcozrKSvVs6bXMHhcF+k= X-MC-Unique: 42pUnnrRNhyPTfH7Iinkxw-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, Ani Sinha , Philippe Mathieu-Daude , mst@redhat.com, imammedo@redhat.com Subject: [PULL 38/56] hw/acpi: changes towards enabling -Wshadow=local Date: Fri, 29 Sep 2023 10:50:35 +0200 Message-ID: <20230929085053.2789105-39-armbru@redhat.com> In-Reply-To: <20230929085053.2789105-1-armbru@redhat.com> References: <20230929085053.2789105-1-armbru@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 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=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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 @redhat.com) X-ZM-MESSAGEID: 1695977779307100009 Content-Type: text/plain; charset="utf-8" From: Ani Sinha Code changes in acpi that addresses all compiler complaints coming from ena= bling -Wshadow flags. Enabling -Wshadow catches cases of local variables shadowing other local variables or parameters. These makes the code confusing and/or = adds bugs that are difficult to catch. See also Subject: Help wanted for enabling -Wshadow=3Dlocal Message-Id: <87r0mqlf9x.fsf@pond.sub.org> https://lore.kernel.org/qemu-devel/87r0mqlf9x.fsf@pond.sub.org The code is tested to build with and without the flag turned on. CC: Markus Armbruster CC: Philippe Mathieu-Daude CC: mst@redhat.com CC: imammedo@redhat.com Signed-off-by: Ani Sinha Message-ID: <20230922124203.127110-1-anisinha@redhat.com> Reviewed-by: Michael S. Tsirkin [Commit message tweaked] Signed-off-by: Markus Armbruster --- hw/acpi/cpu_hotplug.c | 25 +++++++++++++------------ hw/i386/acpi-build.c | 24 ++++++++++++------------ hw/smbios/smbios.c | 37 +++++++++++++++++++------------------ 3 files changed, 44 insertions(+), 42 deletions(-) diff --git a/hw/acpi/cpu_hotplug.c b/hw/acpi/cpu_hotplug.c index ff14c3f410..634bbecb31 100644 --- a/hw/acpi/cpu_hotplug.c +++ b/hw/acpi/cpu_hotplug.c @@ -265,26 +265,27 @@ void build_legacy_cpu_hotplug_aml(Aml *ctx, MachineSt= ate *machine, =20 /* build Processor object for each processor */ for (i =3D 0; i < apic_ids->len; i++) { - int apic_id =3D apic_ids->cpus[i].arch_id; + int cpu_apic_id =3D apic_ids->cpus[i].arch_id; =20 - assert(apic_id < ACPI_CPU_HOTPLUG_ID_LIMIT); + assert(cpu_apic_id < ACPI_CPU_HOTPLUG_ID_LIMIT); =20 - dev =3D aml_processor(i, 0, 0, "CP%.02X", apic_id); + dev =3D aml_processor(i, 0, 0, "CP%.02X", cpu_apic_id); =20 method =3D aml_method("_MAT", 0, AML_NOTSERIALIZED); aml_append(method, - aml_return(aml_call2(CPU_MAT_METHOD, aml_int(apic_id), aml_int= (i)) + aml_return(aml_call2(CPU_MAT_METHOD, + aml_int(cpu_apic_id), aml_int(i)) )); aml_append(dev, method); =20 method =3D aml_method("_STA", 0, AML_NOTSERIALIZED); aml_append(method, - aml_return(aml_call1(CPU_STATUS_METHOD, aml_int(apic_id)))); + aml_return(aml_call1(CPU_STATUS_METHOD, aml_int(cpu_apic_id)))= ); aml_append(dev, method); =20 method =3D aml_method("_EJ0", 1, AML_NOTSERIALIZED); aml_append(method, - aml_return(aml_call2(CPU_EJECT_METHOD, aml_int(apic_id), + aml_return(aml_call2(CPU_EJECT_METHOD, aml_int(cpu_apic_id), aml_arg(0))) ); aml_append(dev, method); @@ -298,11 +299,11 @@ void build_legacy_cpu_hotplug_aml(Aml *ctx, MachineSt= ate *machine, /* Arg0 =3D APIC ID */ method =3D aml_method(AML_NOTIFY_METHOD, 2, AML_NOTSERIALIZED); for (i =3D 0; i < apic_ids->len; i++) { - int apic_id =3D apic_ids->cpus[i].arch_id; + int cpu_apic_id =3D apic_ids->cpus[i].arch_id; =20 - if_ctx =3D aml_if(aml_equal(aml_arg(0), aml_int(apic_id))); + if_ctx =3D aml_if(aml_equal(aml_arg(0), aml_int(cpu_apic_id))); aml_append(if_ctx, - aml_notify(aml_name("CP%.02X", apic_id), aml_arg(1)) + aml_notify(aml_name("CP%.02X", cpu_apic_id), aml_arg(1)) ); aml_append(method, if_ctx); } @@ -319,13 +320,13 @@ void build_legacy_cpu_hotplug_aml(Aml *ctx, MachineSt= ate *machine, aml_varpackage(x86ms->apic_id_limi= t); =20 for (i =3D 0, apic_idx =3D 0; i < apic_ids->len; i++) { - int apic_id =3D apic_ids->cpus[i].arch_id; + int cpu_apic_id =3D apic_ids->cpus[i].arch_id; =20 - for (; apic_idx < apic_id; apic_idx++) { + for (; apic_idx < cpu_apic_id; apic_idx++) { aml_append(pkg, aml_int(0)); } aml_append(pkg, aml_int(apic_ids->cpus[i].cpu ? 1 : 0)); - apic_idx =3D apic_id + 1; + apic_idx =3D cpu_apic_id + 1; } aml_append(sb_scope, aml_name_decl(CPU_ON_BITMAP, pkg)); aml_append(ctx, sb_scope); diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 4d2d40bab5..95199c8900 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -1585,12 +1585,12 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, aml_append(dev, aml_name_decl("_UID", aml_int(bus_num))); aml_append(dev, aml_name_decl("_BBN", aml_int(bus_num))); if (pci_bus_is_cxl(bus)) { - struct Aml *pkg =3D aml_package(2); + struct Aml *aml_pkg =3D aml_package(2); =20 aml_append(dev, aml_name_decl("_HID", aml_string("ACPI0016= "))); - aml_append(pkg, aml_eisaid("PNP0A08")); - aml_append(pkg, aml_eisaid("PNP0A03")); - aml_append(dev, aml_name_decl("_CID", pkg)); + aml_append(aml_pkg, aml_eisaid("PNP0A08")); + aml_append(aml_pkg, aml_eisaid("PNP0A03")); + aml_append(dev, aml_name_decl("_CID", aml_pkg)); build_cxl_osc_method(dev); } else if (pci_bus_is_express(bus)) { aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0A08"= ))); @@ -1783,14 +1783,14 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, Object *pci_host =3D acpi_get_i386_pci_host(); =20 if (pci_host) { - PCIBus *bus =3D PCI_HOST_BRIDGE(pci_host)->bus; - Aml *scope =3D aml_scope("PCI0"); + PCIBus *pbus =3D PCI_HOST_BRIDGE(pci_host)->bus; + Aml *ascope =3D aml_scope("PCI0"); /* Scan all PCI buses. Generate tables to support hotplug. */ - build_append_pci_bus_devices(scope, bus); - if (object_property_find(OBJECT(bus), ACPI_PCIHP_PROP_BSEL)) { - build_append_pcihp_slots(scope, bus); + build_append_pci_bus_devices(ascope, pbus); + if (object_property_find(OBJECT(pbus), ACPI_PCIHP_PROP_BSEL)) { + build_append_pcihp_slots(ascope, pbus); } - aml_append(sb_scope, scope); + aml_append(sb_scope, ascope); } } =20 @@ -1842,10 +1842,10 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, bool has_pcnt; =20 Object *pci_host =3D acpi_get_i386_pci_host(); - PCIBus *bus =3D PCI_HOST_BRIDGE(pci_host)->bus; + PCIBus *b =3D PCI_HOST_BRIDGE(pci_host)->bus; =20 scope =3D aml_scope("\\_SB.PCI0"); - has_pcnt =3D build_append_notfication_callback(scope, bus); + has_pcnt =3D build_append_notfication_callback(scope, b); if (has_pcnt) { aml_append(dsdt, scope); } diff --git a/hw/smbios/smbios.c b/hw/smbios/smbios.c index b753705856..2a90601ac5 100644 --- a/hw/smbios/smbios.c +++ b/hw/smbios/smbios.c @@ -1423,13 +1423,14 @@ void smbios_entry_add(QemuOpts *opts, Error **errp) if (!qemu_opts_validate(opts, qemu_smbios_type8_opts, errp)) { return; } - struct type8_instance *t; - t =3D g_new0(struct type8_instance, 1); - save_opt(&t->internal_reference, opts, "internal_reference"); - save_opt(&t->external_reference, opts, "external_reference"); - t->connector_type =3D qemu_opt_get_number(opts, "connector_typ= e", 0); - t->port_type =3D qemu_opt_get_number(opts, "port_type", 0); - QTAILQ_INSERT_TAIL(&type8, t, next); + struct type8_instance *t8_i; + t8_i =3D g_new0(struct type8_instance, 1); + save_opt(&t8_i->internal_reference, opts, "internal_reference"= ); + save_opt(&t8_i->external_reference, opts, "external_reference"= ); + t8_i->connector_type =3D qemu_opt_get_number(opts, + "connector_type", 0= ); + t8_i->port_type =3D qemu_opt_get_number(opts, "port_type", 0); + QTAILQ_INSERT_TAIL(&type8, t8_i, next); return; case 11: if (!qemu_opts_validate(opts, qemu_smbios_type11_opts, errp)) { @@ -1452,27 +1453,27 @@ void smbios_entry_add(QemuOpts *opts, Error **errp) type17.speed =3D qemu_opt_get_number(opts, "speed", 0); return; case 41: { - struct type41_instance *t; + struct type41_instance *t41_i; Error *local_err =3D NULL; =20 if (!qemu_opts_validate(opts, qemu_smbios_type41_opts, errp)) { return; } - t =3D g_new0(struct type41_instance, 1); - save_opt(&t->designation, opts, "designation"); - t->kind =3D qapi_enum_parse(&type41_kind_lookup, - qemu_opt_get(opts, "kind"), - 0, &local_err) + 1; - t->kind |=3D 0x80; /* enabled */ + t41_i =3D g_new0(struct type41_instance, 1); + save_opt(&t41_i->designation, opts, "designation"); + t41_i->kind =3D qapi_enum_parse(&type41_kind_lookup, + qemu_opt_get(opts, "kind"), + 0, &local_err) + 1; + t41_i->kind |=3D 0x80; /* enabled */ if (local_err !=3D NULL) { error_propagate(errp, local_err); - g_free(t); + g_free(t41_i); return; } - t->instance =3D qemu_opt_get_number(opts, "instance", 1); - save_opt(&t->pcidev, opts, "pcidev"); + t41_i->instance =3D qemu_opt_get_number(opts, "instance", 1); + save_opt(&t41_i->pcidev, opts, "pcidev"); =20 - QTAILQ_INSERT_TAIL(&type41, t, next); + QTAILQ_INSERT_TAIL(&type41, t41_i, next); return; } default: --=20 2.41.0 From nobody Fri May 17 11:29:14 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1695977579; cv=none; d=zohomail.com; s=zohoarc; b=il4hkyOKCAFHY35YVP5aNUxq6YATE5bckDzseGFQiYdqK0ObBBz22ASh39n1ATJFGq3K4lcg/pUGK+xWJYR3o+KsDW00JDpih/lvHvCjXD2ld/GFz2VuCm0PtfO71LrukHkiurC1VqH8ECZ3NXeIF+/9tvXFnJFC8JuDmo46qkQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695977579; 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=rHWFkm0Owm+0KO8bC4d1hG2we6McKOc9L+rx16nbk2Q=; b=Xlm9WCzZy1HgQqG4Op10xAck/MSX7HM7GujNR7qpHCdOeivyAyL7vYdjsI07sRyXChEXJL6J8H7Fy0/5iuxGWSv/axrxv1PYHCLi/Mymveg5ceCnrp9Ya3mdqLR7Y9G8VOaggphkskGlpjwXm2KLORowcJ/YWUvYXrvW32HhtzQ= 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 1695977579205424.4195201616784; Fri, 29 Sep 2023 01:52:59 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qm9De-0005Cg-L7; Fri, 29 Sep 2023 04:51:31 -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 1qm9DW-00052W-4r for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:22 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qm9DC-0005dJ-N0 for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:21 -0400 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-563-39KKLhHvN0SlLEPlHM0Oyg-1; Fri, 29 Sep 2023 04:50:58 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A3B983C025BC; Fri, 29 Sep 2023 08:50:57 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 814E19A; Fri, 29 Sep 2023 08:50:57 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id C5E3121E689C; Fri, 29 Sep 2023 10:50:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695977461; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rHWFkm0Owm+0KO8bC4d1hG2we6McKOc9L+rx16nbk2Q=; b=Rud8lAI7BtPcmbiQGC3XhEOPw2OeYXJ3DJlO7aCNBBI71IUAALBa5pH77SI38NT37LwGYu qgBFUtZ0Kt4omySqaQwx9112SYLzxl7LYWwytYih8gba1Ffv547CA0E7rToqz2mmWeiWaQ 6ZsA8HzT1DozSrrfl3xZDvXNMLfi+9A= X-MC-Unique: 39KKLhHvN0SlLEPlHM0Oyg-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eric Auger Subject: [PULL 39/56] hw/intc/arm_gicv3_its: Avoid shadowing variable in do_process_its_cmd() Date: Fri, 29 Sep 2023 10:50:36 +0200 Message-ID: <20230929085053.2789105-40-armbru@redhat.com> In-Reply-To: <20230929085053.2789105-1-armbru@redhat.com> References: <20230929085053.2789105-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 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=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, 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 @redhat.com) X-ZM-MESSAGEID: 1695977580629100001 From: Peter Maydell 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 Message-ID: <20230922152944.3583438-2-peter.maydell@linaro.org> Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Eric Auger Signed-off-by: Markus Armbruster --- 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 5f552b4d37..52e9aca9c6 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.41.0 From nobody Fri May 17 11:29:14 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1695978073; cv=none; d=zohomail.com; s=zohoarc; b=KB9Rao+GFamInIJx3ijwFd6XZHw3CwUIDPiAikCpwwU5xHpbzPILghClaxKBnAwXHwV/ZB72RNvVgU+4KZSjRI/iWLO99AVUClXkCGQBv+sEOzfL4p+XHaW6tG+Q4kLIIJ+ixjME+MjJ4cqTGa2a9HiJNAA22M4tGKMit45cNsw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695978073; 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=T4GjYDCb7xOJWXlG+vnKWW+7by992abrtrTUH3d+Z1Q=; b=Q9w/n7N/Xo+DB+9CI+AqOXYU6v7tK7vN8vb85p/rRP9PWeg5jlrfejiC+4qpu4kL6Um5dKsITbB+UcCkmIvtPZ4/E2afCzhVo4E8meLQrwIrRxhj4+tM/JSJiq9uD0MOTFCkcwV2lRfKR9P56czUd5UxSInTYA2yyn/SBgP6g3E= 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 1695978073386434.97722784549944; Fri, 29 Sep 2023 02:01:13 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qm9Mi-0001qS-3Y; Fri, 29 Sep 2023 05:00:53 -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 1qm9Mb-0001mc-E5 for qemu-devel@nongnu.org; Fri, 29 Sep 2023 05:00:46 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qm9MN-0008Bb-Nw for qemu-devel@nongnu.org; Fri, 29 Sep 2023 05:00:45 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-539-cI-9u3zxNNyyh6XhV0cGvw-1; Fri, 29 Sep 2023 05:00:27 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6F9D5802D38; Fri, 29 Sep 2023 09:00:27 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4C901176E4; Fri, 29 Sep 2023 09:00:27 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id C8BE621E689D; Fri, 29 Sep 2023 10:50:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695978029; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=T4GjYDCb7xOJWXlG+vnKWW+7by992abrtrTUH3d+Z1Q=; b=QddJfZ4E/5BOSZMNk/ssMI56TmfYgUkZ2UR4kmIe7mUMGc3bC49pAnpnw7nMcpDOX6tgB5 iKSpWurjg8sGtCklq5DKas3VjUu7KaVZjCqyw3VusCBTqae6PSr1en8jgC/aZhiAa5g/nP LiGsieMQnDoV1LVg6xvSSd+Qz9wI/Ws= X-MC-Unique: cI-9u3zxNNyyh6XhV0cGvw-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eric Auger Subject: [PULL 40/56] hw/misc/arm_sysctl.c: Avoid shadowing local variable Date: Fri, 29 Sep 2023 10:50:37 +0200 Message-ID: <20230929085053.2789105-41-armbru@redhat.com> In-Reply-To: <20230929085053.2789105-1-armbru@redhat.com> References: <20230929085053.2789105-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 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=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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 @redhat.com) X-ZM-MESSAGEID: 1695978074696100003 From: Peter Maydell 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 Message-ID: <20230922152944.3583438-3-peter.maydell@linaro.org> Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Eric Auger Signed-off-by: Markus Armbruster --- 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 42d4693854..3e4f4b0524 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.41.0 From nobody Fri May 17 11:29:14 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1695977843; cv=none; d=zohomail.com; s=zohoarc; b=cDbpCmqVk1CKJ2a+in3BPcIW9JNpkXmDXlxyJaZ/KWhyDQeJ6ZicBJDQR1t722T/rHvrvspxNE9Q1L7f/R6tawM5Ft7UlNNcf0M1GRUoo/Hrizug9RYmMzeUfO8tasBLUnJKFFvVuCef57UcPEvN4Y+NcfXmKTC8BFIl4uc6Kik= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695977843; 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=y6oUritT/tvNge4hpZhsru6x2nNnKpQ7C/KLQ2rP0D0=; b=G8OtxsjX19SbQ3XzQm1QjLLamiIbz4QlcEgqyYsxdW98cIucIMiUxoVDa8GutQYEuSnQElKiJIWDm9s14oW7XKwfNoGgdnEhP91080T5+Ngck6xytDqT3DxWX5tCkGsbkaSE8i3XqPpTcVDxyHqXq/CX/XwcviEeZgxqW+kEe3E= 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 1695977843122908.0827039129383; Fri, 29 Sep 2023 01:57:23 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qm9Dm-0005J7-4S; Fri, 29 Sep 2023 04:51:38 -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 1qm9Dc-0005Bq-IR for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:28 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qm9DC-0005d2-V0 for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:28 -0400 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-29-iL2UWVfDNJKfEiOdOqpwZQ-1; Fri, 29 Sep 2023 04:50:58 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id AF1C81C0514A; Fri, 29 Sep 2023 08:50:57 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8D34640C6EBF; Fri, 29 Sep 2023 08:50:57 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id CB96621E689E; Fri, 29 Sep 2023 10:50:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695977461; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=y6oUritT/tvNge4hpZhsru6x2nNnKpQ7C/KLQ2rP0D0=; b=gerCQHHJPpOWZpKnyQpieAljMoDLKZ1qXAzaP2mY+8McHscROPwN6VeCVbBh7ABHEkh88Y wcc0xVi8CGa2OiMpKjerw1kzxEuTXSB4vBHF7JGtHmY7Ia2Blz1NEVnlumgHG0uRDq/4V/ 5p64FDSVga556z7dg/Brx1mDlGxNOWk= X-MC-Unique: iL2UWVfDNJKfEiOdOqpwZQ-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eric Auger Subject: [PULL 41/56] hw/arm/smmuv3.c: Avoid shadowing variable Date: Fri, 29 Sep 2023 10:50:38 +0200 Message-ID: <20230929085053.2789105-42-armbru@redhat.com> In-Reply-To: <20230929085053.2789105-1-armbru@redhat.com> References: <20230929085053.2789105-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 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=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, 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 @redhat.com) X-ZM-MESSAGEID: 1695977843507100001 From: Peter Maydell 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 Message-ID: <20230922152944.3583438-4-peter.maydell@linaro.org> Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Eric Auger Signed-off-by: Markus Armbruster --- 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 1e9be8e89a..6f2b2bd45f 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.41.0 From nobody Fri May 17 11:29:14 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1695978177; cv=none; d=zohomail.com; s=zohoarc; b=aWBNwP1MM0pRLAsaiDUnxT4lICEOSFtKbC+Wips9Be3O+GvAwwCe4Rl/YztZ7XRCyWgLqoC3a0SfwzWu08aBOB05slfs/1o6MrsFgePiCYvOd/mzkZP0xcHuSteynpOaHQLUNFJqpBlqi5OXsuViGT+k0pVp6xO0BvkAl5izMyk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695978177; 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=/+dpUECFCMcZ38HJNY0Gx8doEP4arUzG5jpycPf5+yc=; b=S2I1m1aWfR77HB0yTUPxGslEHpi+cbrfSBp2LyjqP1E7x01cqHybxh94OHj+u5DHM6lZ6UYoBS9jjByKgJzIhfuzTk1kzMcTZVC8YTyoPqGCUuV2kskVe9hZ/h7M9FqtnV9XGuRhD5Pn89XFul+VW5BtjNpfkwNYloawgdQLzvw= 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 1695978177672822.6737558782115; Fri, 29 Sep 2023 02:02:57 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qm9Mr-000235-SD; Fri, 29 Sep 2023 05:01:01 -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 1qm9Mh-0001qg-Ht for qemu-devel@nongnu.org; Fri, 29 Sep 2023 05:00:52 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qm9MO-0008Bw-D4 for qemu-devel@nongnu.org; Fri, 29 Sep 2023 05:00:50 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-52-SxpB8XR9OESt43ESgH-RpA-1; Fri, 29 Sep 2023 05:00:27 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8C2DB1019C99; Fri, 29 Sep 2023 09:00:27 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4DB37176EA; Fri, 29 Sep 2023 09:00:27 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id CE86621E689F; Fri, 29 Sep 2023 10:50:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695978031; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/+dpUECFCMcZ38HJNY0Gx8doEP4arUzG5jpycPf5+yc=; b=Qi09158uMOp04OfGjik2uwtl3JUALlPl6tOZsOJUFV6HYlX2X0pMePUgP0gkhRnuXQVrdb jav5pQdVPO0SGvJrJ9kOtE2OI7z28hPc20RGlu6CfSFUhtBg58WJPgPxgYnIWhIAgbuVko /rEtz6yDgPG+iQuVGv3T1U1loN7gj2M= X-MC-Unique: SxpB8XR9OESt43ESgH-RpA-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, Peter Maydell , Eric Auger Subject: [PULL 42/56] hw/arm/smmuv3-internal.h: Don't use locals in statement macros Date: Fri, 29 Sep 2023 10:50:39 +0200 Message-ID: <20230929085053.2789105-43-armbru@redhat.com> In-Reply-To: <20230929085053.2789105-1-armbru@redhat.com> References: <20230929085053.2789105-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 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=170.10.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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 @redhat.com) X-ZM-MESSAGEID: 1695978179664100003 From: Peter Maydell 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 Message-ID: <20230922152944.3583438-5-peter.maydell@linaro.org> Reviewed-by: Eric Auger Signed-off-by: Markus Armbruster --- 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 6d1c1edab7..648c2e37a2 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.41.0 From nobody Fri May 17 11:29:14 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1695977778; cv=none; d=zohomail.com; s=zohoarc; b=AW122HX6fUx4oWE+Mb6QQ38Pc74GE6WTbLBr3GHPyCo1gv5MY548uDBsZpXEnobdxa5TGUFGFk73gDh5hVwF8DEeLw7K6Lpf4LvibuFRk8JlLn/gkB2hwu1fD65hDqraUVU+ldRU5/A9sSyM9gStalKeDYxgpYmqhN5f6095ZHI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695977778; 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=c2D2N7WlErJVlyiWJzSeQqa76674rJVo9x5Y5NUFAJc=; b=hlVb+4nP7EDbqvCOwt9gEv82aAgiHtm/t+h1unx5h5GfcHBE7TsyOm//Y3OYzC+qfdHzQgt9axxc7HHqYyrkpxrREeR6VzvwhXNK4C7hh8GfXzui1B7+LgsPG9QJfv84sUd/+hIIiTqi0knBaSErw6Gk/dzp1IDvb307vbNtW4Q= 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 1695977778527342.1155502182753; Fri, 29 Sep 2023 01:56:18 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qm9Do-0005Kk-1k; Fri, 29 Sep 2023 04:51:40 -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 1qm9Dj-0005Gr-6i for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:35 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.145.221.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qm9DE-0005dq-Tl for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:33 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-2-XnElkFbCMbKUYbTzkhwo2A-1; Fri, 29 Sep 2023 04:50:58 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2ACB1803DBD; Fri, 29 Sep 2023 08:50:58 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 08BEA10F1BE8; Fri, 29 Sep 2023 08:50:57 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id D16A921E68A0; Fri, 29 Sep 2023 10:50:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695977462; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=c2D2N7WlErJVlyiWJzSeQqa76674rJVo9x5Y5NUFAJc=; b=b+ptWj0lRnzvVKtV4HZKlAZs7V69E0aaY0p4mk+RA7Geq3cM2gL0O+Ld/DTmQ+cnyBgGyh hsio3mbDZBMMn0Su59yDyxmalpzU6Sjv/C5kowARpwEVqAdaNhDp0AZ0ANRiEIiR1ZG95K Cc70FoMXzHwTwU3Sd3aZ5JGEfNtJydw= X-MC-Unique: XnElkFbCMbKUYbTzkhwo2A-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Joel Stanley Subject: [PULL 43/56] aspeed/i2c: Clean up local variable shadowing Date: Fri, 29 Sep 2023 10:50:40 +0200 Message-ID: <20230929085053.2789105-44-armbru@redhat.com> In-Reply-To: <20230929085053.2789105-1-armbru@redhat.com> References: <20230929085053.2789105-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 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=216.145.221.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, 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, T_SPF_TEMPERROR=0.01 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 @redhat.com) X-ZM-MESSAGEID: 1695977780499100011 From: C=C3=A9dric Le Goater Remove superfluous local 'data' variable and use the one define at the top of the routine. This fixes : ../hw/i2c/aspeed_i2c.c: In function =E2=80=98aspeed_i2c_bus_recv=E2=80=99: ../hw/i2c/aspeed_i2c.c:315:17: warning: declaration of =E2=80=98data=E2= =80=99 shadows a previous local [-Wshadow=3Dcompatible-local] 315 | uint8_t data; | ^~~~ ../hw/i2c/aspeed_i2c.c:288:13: note: shadowed declaration is here 288 | uint8_t data; | ^~~~ Signed-off-by: C=C3=A9dric Le Goater Message-ID: <20230922155924.1172019-2-clg@kaod.org> Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Joel Stanley Signed-off-by: Markus Armbruster --- hw/i2c/aspeed_i2c.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/i2c/aspeed_i2c.c b/hw/i2c/aspeed_i2c.c index 7275d40749..1037c22b2f 100644 --- a/hw/i2c/aspeed_i2c.c +++ b/hw/i2c/aspeed_i2c.c @@ -312,7 +312,6 @@ static void aspeed_i2c_bus_recv(AspeedI2CBus *bus) SHARED_ARRAY_FIELD_DP32(bus->regs, reg_pool_ctrl, RX_COUNT, i & 0x= ff); SHARED_ARRAY_FIELD_DP32(bus->regs, reg_cmd, RX_BUFF_EN, 0); } else if (SHARED_ARRAY_FIELD_EX32(bus->regs, reg_cmd, RX_DMA_EN)) { - uint8_t data; /* In new mode, clear how many bytes we RXed */ if (aspeed_i2c_is_new_mode(bus->controller)) { ARRAY_FIELD_DP32(bus->regs, I2CM_DMA_LEN_STS, RX_LEN, 0); --=20 2.41.0 From nobody Fri May 17 11:29:14 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1695977870; cv=none; d=zohomail.com; s=zohoarc; b=jOzw1VXAWf7UE+Tb9cN1eSr54aq7qcSlwj7xKd8E96SInh0XbI+DNLGX9wkkJ5LiHldHevxC1vmaOE9w0Khw/9DwBLAsVdkfDHNgYQMZwSdFivVATcPQzqo0J20M2fRKPjiyCa+6dGFHfk9UnaJA3lPwAyhzsHmWehrF9WRT55U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695977870; 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=HwpHxK4G0HNzcwEl8e+YKuNMHJXerkGYwDjFt5d4jK8=; b=RCcYdWwarNDuanDq+xePgzyUoAhfZWdHjl1W7G6VhdZKlCUUc5oVN2XGgTKpSl3SD8t83MW9Uu85+bvdtN0ndhtJnbB3wwpqQpe6/DzlS4AnfsSmoTZOi3fD3MPdY/RfNClOmF2qHAjBLjosqiXzAlO8rYSSl2/VjmgW5o1WPx8= 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 1695977870554498.98940631557105; Fri, 29 Sep 2023 01:57:50 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qm9Dl-0005J5-JX; Fri, 29 Sep 2023 04:51:37 -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 1qm9Dh-0005Ek-5k for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:33 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qm9DF-0005ee-Bk for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:32 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-538-ZXULGJfePkOtwbK_egpK3Q-1; Fri, 29 Sep 2023 04:50:58 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id BFE08803470; Fri, 29 Sep 2023 08:50:57 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9DC82C15BB8; Fri, 29 Sep 2023 08:50:57 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id D436621E68A1; Fri, 29 Sep 2023 10:50:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695977463; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HwpHxK4G0HNzcwEl8e+YKuNMHJXerkGYwDjFt5d4jK8=; b=IDiRiukd2JTtd1L1N/n8uF7MYgU2UO7+jjJAFRyLO4s2fWEUv3fjml9RXFFzFsSlrMqBEz VYJQn1sUwqUJgwBbY9Gnb0A95NCHM4DsMjsTN9uwt8Xm3Nx+TSxGLbRLkZ4gMwv8nI2V9e ippnO4+7Z5t/qor6K+t1g88Az6xuj7E= X-MC-Unique: ZXULGJfePkOtwbK_egpK3Q-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 44/56] aspeed: Clean up local variable shadowing Date: Fri, 29 Sep 2023 10:50:41 +0200 Message-ID: <20230929085053.2789105-45-armbru@redhat.com> In-Reply-To: <20230929085053.2789105-1-armbru@redhat.com> References: <20230929085053.2789105-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 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=170.10.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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 @redhat.com) X-ZM-MESSAGEID: 1695977871588100001 From: C=C3=A9dric Le Goater Remove superfluous local 'irq' variables and use the one define at the top of the routine. This fixes warnings in aspeed_soc_ast2600_realize() such as : ../hw/arm/aspeed_ast2600.c: In function =E2=80=98aspeed_soc_ast2600_reali= ze=E2=80=99: ../hw/arm/aspeed_ast2600.c:420:18: warning: declaration of =E2=80=98irq= =E2=80=99 shadows a previous local [-Wshadow=3Dcompatible-local] 420 | qemu_irq irq =3D aspeed_soc_get_irq(s, ASPEED_DEV_TIMER1 = + i); | ^~~ ../hw/arm/aspeed_ast2600.c:312:14: note: shadowed declaration is here 312 | qemu_irq irq; | ^~~ Signed-off-by: C=C3=A9dric Le Goater Message-ID: <20230922155924.1172019-3-clg@kaod.org> Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Markus Armbruster --- hw/arm/aspeed_ast2600.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/arm/aspeed_ast2600.c b/hw/arm/aspeed_ast2600.c index a8b3a8065a..e122e1c32d 100644 --- a/hw/arm/aspeed_ast2600.c +++ b/hw/arm/aspeed_ast2600.c @@ -388,7 +388,7 @@ static void aspeed_soc_ast2600_realize(DeviceState *dev= , Error **errp) aspeed_mmio_map(s, SYS_BUS_DEVICE(&s->timerctrl), 0, sc->memmap[ASPEED_DEV_TIMER1]); for (i =3D 0; i < ASPEED_TIMER_NR_TIMERS; i++) { - qemu_irq irq =3D aspeed_soc_get_irq(s, ASPEED_DEV_TIMER1 + i); + irq =3D aspeed_soc_get_irq(s, ASPEED_DEV_TIMER1 + i); sysbus_connect_irq(SYS_BUS_DEVICE(&s->timerctrl), i, irq); } =20 @@ -413,8 +413,8 @@ static void aspeed_soc_ast2600_realize(DeviceState *dev= , Error **errp) } aspeed_mmio_map(s, SYS_BUS_DEVICE(&s->i2c), 0, sc->memmap[ASPEED_DEV_I= 2C]); for (i =3D 0; i < ASPEED_I2C_GET_CLASS(&s->i2c)->num_busses; i++) { - qemu_irq irq =3D qdev_get_gpio_in(DEVICE(&s->a7mpcore), - sc->irqmap[ASPEED_DEV_I2C] + i); + irq =3D qdev_get_gpio_in(DEVICE(&s->a7mpcore), + sc->irqmap[ASPEED_DEV_I2C] + i); /* The AST2600 I2C controller has one IRQ per bus. */ sysbus_connect_irq(SYS_BUS_DEVICE(&s->i2c.busses[i]), 0, irq); } @@ -611,8 +611,8 @@ static void aspeed_soc_ast2600_realize(DeviceState *dev= , Error **errp) } aspeed_mmio_map(s, SYS_BUS_DEVICE(&s->i3c), 0, sc->memmap[ASPEED_DEV_I= 3C]); for (i =3D 0; i < ASPEED_I3C_NR_DEVICES; i++) { - qemu_irq irq =3D qdev_get_gpio_in(DEVICE(&s->a7mpcore), - sc->irqmap[ASPEED_DEV_I3C] + i); + irq =3D qdev_get_gpio_in(DEVICE(&s->a7mpcore), + sc->irqmap[ASPEED_DEV_I3C] + i); /* The AST2600 I3C controller has one IRQ per bus. */ sysbus_connect_irq(SYS_BUS_DEVICE(&s->i3c.devices[i]), 0, irq); } --=20 2.41.0 From nobody Fri May 17 11:29:14 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1695977802; cv=none; d=zohomail.com; s=zohoarc; b=emdOTJiGwdtG+61x1ORKMOzi+tfFEEsoUKUbBjEDiXwXRlG3iDefTvCiMCDCBmQj3hpnS+EG8M1AbLhtJuy8B2UaOF0xnwlANv970fVgSHzZ2l7sMXVYLkWQmQz+2Nj5+n4OpRNOClLFcfTIMOyEmt3UNA6FlcgVc+w+VM0dhOw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695977802; 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=H1WyZPQihKKRvCMSxzXzu6GeHQY2ALdqX2ziwjriSxg=; b=de1lRSkDJLczGV5uIgZY0qBjyELf8RF4NzFNVh4Aydzs4Kn8w2M5iLPZnUPgOZLgLTvldL1m3sFtf+sVPlkxpC4ViQEDU4EyDq7IHOgbzktDk2fkX0B9dVk3dLgpbkJv+LRLHV+Ce94RWTprRDBIWIGNSemGEzJOC6y2pt3yEnI= 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 169597780223940.736698620583866; Fri, 29 Sep 2023 01:56:42 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qm9DX-00055n-I9; Fri, 29 Sep 2023 04:51:23 -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 1qm9DV-000522-Sz for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:21 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.145.221.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qm9DC-0005cm-N2 for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:21 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-2-WOKEJ8IlOcOA7L4cn_dgfw-1; Fri, 29 Sep 2023 04:50:58 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0E9E1101A550; Fri, 29 Sep 2023 08:50:58 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E01F914171CB; Fri, 29 Sep 2023 08:50:57 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id D85BB21E68A2; Fri, 29 Sep 2023 10:50:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695977461; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=H1WyZPQihKKRvCMSxzXzu6GeHQY2ALdqX2ziwjriSxg=; b=CEBgQTu59Pci53ThsNoHhswUVOdfVnfMzbQKFm003ooP9eeBiB31h6fFLx1V10J2Z4L73L YblV2wP31OIlkZKauSn6PXNnQsoOuAUD4HQ9Nz2lWxozfd5YmadIq+++Qp1iQ29LB+WXAj jHBTiPDPjYHVzR6hnCcuN1bvG1U9ChQ= X-MC-Unique: WOKEJ8IlOcOA7L4cn_dgfw-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Andrew Jeffery Subject: [PULL 45/56] aspeed/i3c: Rename variable shadowing a local Date: Fri, 29 Sep 2023 10:50:42 +0200 Message-ID: <20230929085053.2789105-46-armbru@redhat.com> In-Reply-To: <20230929085053.2789105-1-armbru@redhat.com> References: <20230929085053.2789105-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 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=216.145.221.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, 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 @redhat.com) X-ZM-MESSAGEID: 1695977803561100011 From: C=C3=A9dric Le Goater to fix warning : ../hw/i3c/aspeed_i3c.c: In function =E2=80=98aspeed_i3c_realize=E2=80=99: ../hw/i3c/aspeed_i3c.c:1959:17: warning: declaration of =E2=80=98dev=E2= =80=99 shadows a parameter [-Wshadow=3Dlocal] 1959 | Object *dev =3D OBJECT(&s->devices[i]); | ^~~ ../hw/i3c/aspeed_i3c.c:1942:45: note: shadowed declaration is here 1942 | static void aspeed_i3c_realize(DeviceState *dev, Error **errp) | ~~~~~~~~~~~~~^~~ Signed-off-by: C=C3=A9dric Le Goater Message-ID: <20230922155924.1172019-4-clg@kaod.org> Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Andrew Jeffery Signed-off-by: Markus Armbruster --- hw/misc/aspeed_i3c.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/misc/aspeed_i3c.c b/hw/misc/aspeed_i3c.c index f54f5da522..d1ff617671 100644 --- a/hw/misc/aspeed_i3c.c +++ b/hw/misc/aspeed_i3c.c @@ -296,13 +296,13 @@ static void aspeed_i3c_realize(DeviceState *dev, Erro= r **errp) memory_region_add_subregion(&s->iomem_container, 0x0, &s->iomem); =20 for (i =3D 0; i < ASPEED_I3C_NR_DEVICES; ++i) { - Object *dev =3D OBJECT(&s->devices[i]); + Object *i3c_dev =3D OBJECT(&s->devices[i]); =20 - if (!object_property_set_uint(dev, "device-id", i, errp)) { + if (!object_property_set_uint(i3c_dev, "device-id", i, errp)) { return; } =20 - if (!sysbus_realize(SYS_BUS_DEVICE(dev), errp)) { + if (!sysbus_realize(SYS_BUS_DEVICE(i3c_dev), errp)) { return; } =20 --=20 2.41.0 From nobody Fri May 17 11:29:14 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1695978054; cv=none; d=zohomail.com; s=zohoarc; b=g+sflmkW10nmbz0ER3Xlze8ITzwfYOFhNpDoaCFAs9OxNJ2vlUCYhRUFp5uPmj6U12z4YKvg7WQAT2oEKU3Mv6DPK8dHrmyUNwSbffS9mmtXvXIAC9IwJG5wzccd3SIOsj1P0YaeNJ07u4LJ+CP3kIBmZgqcSavT6u0AxMDupgY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695978054; 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=2+QjRvp3xEKiyrdGhfSbaHvdWg1xeZJy16DjtM+7W3I=; b=C9KU4K84pKBuPqnHGpPrDeIoyGW3Wogf2rnmA/TNJmjK2522afHf88F8HpvMfp7LN+UdLPNSfEdicLQ1ZDbS85GgtBb4AXRvaUNYLgTUE8weFBiecz3p3TllP1P0C5RIb86E/ftYQ7fqjzzIy2Uwq2F7l2kagi5mLdCh9+yzKT8= 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 1695978054487697.3394704985114; Fri, 29 Sep 2023 02:00:54 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qm9MX-0001lb-8H; Fri, 29 Sep 2023 05:00:42 -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 1qm9MS-0001i7-Nn for qemu-devel@nongnu.org; Fri, 29 Sep 2023 05:00:37 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qm9MM-0008BV-J6 for qemu-devel@nongnu.org; Fri, 29 Sep 2023 05:00:35 -0400 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-52-xdb59CrMO4K0qrLgeHKuiw-1; Fri, 29 Sep 2023 05:00:27 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7163C3806737; Fri, 29 Sep 2023 09:00:27 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4D4AAC15BB8; Fri, 29 Sep 2023 09:00:27 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id DA23121E68A3; Fri, 29 Sep 2023 10:50:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695978029; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2+QjRvp3xEKiyrdGhfSbaHvdWg1xeZJy16DjtM+7W3I=; b=ixba2SUKG31U/xdq3fVI6NInNIIwC9vi3SafOHMyUl7LSIIhDki7ETqgZ+Bwbsjj4QawxL lQ+QSzVXuFq2owKWqOq2AYjzj70IpoktCxjZ1EMXeamHco4stF/C5M+srn7ogEUogAz9M7 TLB0hNacZD0sXGRKZlsRnhKk+BhlAs4= X-MC-Unique: xdb59CrMO4K0qrLgeHKuiw-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Joel Stanley , Andrew Jeffery , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 46/56] aspeed/timer: Clean up local variable shadowing Date: Fri, 29 Sep 2023 10:50:43 +0200 Message-ID: <20230929085053.2789105-47-armbru@redhat.com> In-Reply-To: <20230929085053.2789105-1-armbru@redhat.com> References: <20230929085053.2789105-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 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=170.10.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 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, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, 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 @redhat.com) X-ZM-MESSAGEID: 1695978055789100007 From: C=C3=A9dric Le Goater commit 8137355e850f ("aspeed/timer: Fix behaviour running Linux") introduced a MAX() expression to calculate the next timer deadline : return calculate_time(t, MAX(MAX(t->match[0], t->match[1]), 0)); The second MAX() is not necessary since the compared values are an unsigned and 0. Simply remove it and fix warning : ../hw/timer/aspeed_timer.c: In function =E2=80=98calculate_next=E2=80=99: ../include/qemu/osdep.h:396:31: warning: declaration of =E2=80=98_a=E2=80= =99 shadows a previous local [-Wshadow=3Dcompatible-local] 396 | typeof(1 ? (a) : (b)) _a =3D (a), _b =3D (b); \ | ^~ ../hw/timer/aspeed_timer.c:170:12: note: in expansion of macro =E2=80=98M= AX=E2=80=99 170 | next =3D MAX(MAX(calculate_match(t, 0), calculate_match(t, 1)= ), 0); | ^~~ ../hw/timer/aspeed_timer.c:170:16: note: in expansion of macro =E2=80=98M= AX=E2=80=99 170 | next =3D MAX(MAX(calculate_match(t, 0), calculate_match(t, 1)= ), 0); | ^~~ /home/legoater/work/qemu/qemu-aspeed.git/include/qemu/osdep.h:396:31: not= e: shadowed declaration is here 396 | typeof(1 ? (a) : (b)) _a =3D (a), _b =3D (b); \ | ^~ ../hw/timer/aspeed_timer.c:170:12: note: in expansion of macro =E2=80=98M= AX=E2=80=99 170 | next =3D MAX(MAX(calculate_match(t, 0), calculate_match(t, 1)= ), 0); | ^~~ Cc: Joel Stanley Cc: Andrew Jeffery Signed-off-by: C=C3=A9dric Le Goater Message-ID: <20230922155924.1172019-5-clg@kaod.org> Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Markus Armbruster --- hw/timer/aspeed_timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/timer/aspeed_timer.c b/hw/timer/aspeed_timer.c index 9c20b3d6ad..72161f07bb 100644 --- a/hw/timer/aspeed_timer.c +++ b/hw/timer/aspeed_timer.c @@ -167,7 +167,7 @@ static uint64_t calculate_next(struct AspeedTimer *t) qemu_set_irq(t->irq, t->level); } =20 - next =3D MAX(MAX(calculate_match(t, 0), calculate_match(t, 1)), 0); + next =3D MAX(calculate_match(t, 0), calculate_match(t, 1)); t->start =3D qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); =20 return calculate_time(t, next); --=20 2.41.0 From nobody Fri May 17 11:29:14 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1695977633; cv=none; d=zohomail.com; s=zohoarc; b=PwwUpkW+/vfST2Bc7Y7lotaR46p0JaNOyXOJW7gTjyYs3uZ6CPPGQzJlJANP1AVsYm5tQeRb79t1+Fn4awFiBbwGBaejtmUNy9GxCsYlw6rNENeaH4upf3srcXaUk9rKIcrqQqiMzlXjZzd6lRGH3N+qEM7ken81jDYdHLluip4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695977633; 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=40dFwdEDYjBk/PJiIMChICvIvPp7xMTuD7Ew4mW7k94=; b=HbuSxjaMkFaSHDReSLB+im5rQmb8sc9MGEvJWRAJrSZoaKNq32t/WvhUasIKjhe9ehp5DIyrj/TSMa7HMvqdagD0TD/hl1sfFyI4Vq+ThfpSOd6RriJjlMQ4xWyo89mnKMePJdcMB3uDS01yCJ6PU8IfwCqbBk003DWCbFLjYLo= 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 1695977633456931.6683836312272; Fri, 29 Sep 2023 01:53:53 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qm9DW-00053E-KH; Fri, 29 Sep 2023 04:51:22 -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 1qm9DO-0004zS-Fv for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:14 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qm9DB-0005c7-Gk for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:13 -0400 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-163-XlOpw6q7NBCuhAcp6F5ogA-1; Fri, 29 Sep 2023 04:50:58 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 03C781C08967; Fri, 29 Sep 2023 08:50:58 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BC5DC9A; Fri, 29 Sep 2023 08:50:57 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id DD49621E68A4; Fri, 29 Sep 2023 10:50:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695977460; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=40dFwdEDYjBk/PJiIMChICvIvPp7xMTuD7Ew4mW7k94=; b=gIbarsJ/008kOr9A7qQfSHFxsbzLNDlrCPfh2j4VQqEzA1mR21UxrfFzyafdhW+jYE0elA FK8JbHrz+noC5PkG10T38A+tUSM+U5Xvtd7FWjNKHus1O86kRhP0oGBkFBfxuB1+tskGlP LF78QbUNu8gNVPMQjCwPLjq1efsy4vU= X-MC-Unique: XlOpw6q7NBCuhAcp6F5ogA-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, Peter Xu , Jason Wang , Eric Auger , "Michael S . Tsirkin" , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 47/56] intel_iommu: Fix shadow local variables on "size" Date: Fri, 29 Sep 2023 10:50:44 +0200 Message-ID: <20230929085053.2789105-48-armbru@redhat.com> In-Reply-To: <20230929085053.2789105-1-armbru@redhat.com> References: <20230929085053.2789105-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 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=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, 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 @redhat.com) X-ZM-MESSAGEID: 1695977634212100002 From: Peter Xu This patch fixes the warning of shadowed local variable: ../hw/i386/intel_iommu.c: In function =E2=80=98vtd_address_space_unmap=E2= =80=99: ../hw/i386/intel_iommu.c:3773:18: warning: declaration of =E2=80=98size=E2= =80=99 shadows a previous local [-Wshadow=3Dcompatible-local] 3773 | uint64_t size =3D mask + 1; | ^~~~ ../hw/i386/intel_iommu.c:3747:12: note: shadowed declaration is here 3747 | hwaddr size, remain; | ^~~~ Cc: Jason Wang Cc: Eric Auger Cc: Michael S. Tsirkin Cc: Markus Armbruster Signed-off-by: Peter Xu Message-ID: <20230922160410.138786-1-peterx@redhat.com> Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Michael S. Tsirkin Signed-off-by: Markus Armbruster --- hw/i386/intel_iommu.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index c0ce896668..2c832ab68b 100644 --- a/hw/i386/intel_iommu.c +++ b/hw/i386/intel_iommu.c @@ -3744,7 +3744,7 @@ VTDAddressSpace *vtd_find_add_as(IntelIOMMUState *s, = PCIBus *bus, /* Unmap the whole range in the notifier's scope. */ static void vtd_address_space_unmap(VTDAddressSpace *as, IOMMUNotifier *n) { - hwaddr size, remain; + hwaddr total, remain; hwaddr start =3D n->start; hwaddr end =3D n->end; IntelIOMMUState *s =3D as->iommu_state; @@ -3765,7 +3765,7 @@ static void vtd_address_space_unmap(VTDAddressSpace *= as, IOMMUNotifier *n) } =20 assert(start <=3D end); - size =3D remain =3D end - start + 1; + total =3D remain =3D end - start + 1; =20 while (remain >=3D VTD_PAGE_SIZE) { IOMMUTLBEvent event; @@ -3793,10 +3793,10 @@ static void vtd_address_space_unmap(VTDAddressSpace= *as, IOMMUNotifier *n) trace_vtd_as_unmap_whole(pci_bus_num(as->bus), VTD_PCI_SLOT(as->devfn), VTD_PCI_FUNC(as->devfn), - n->start, size); + n->start, total); =20 map.iova =3D n->start; - map.size =3D size - 1; /* Inclusive */ + map.size =3D total - 1; /* Inclusive */ iova_tree_remove(as->iova_tree, map); } =20 --=20 2.41.0 From nobody Fri May 17 11:29:14 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1695978141; cv=none; d=zohomail.com; s=zohoarc; b=EOxqD1h8i8M8vRjE7A4nRTm7x8RyH8U2ppec4vUil7lhg4bcbFMEt+EPl87TNjsHXubvZyMLnvidq6F7B1YiZtwAycvXij8h8kJOTT6s5hFU+LLqM4A3q9+JPzi+1Z9oiXyGmlC5MYD/22uon4HC8pnmJJU3/5d6KJjzTzlrbC0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695978141; 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=0LkSdnRNCy5pkkQ2a7BaQrKQ4x7DFab3zNu5N+cOmKc=; b=MBDWfi/Rf/JQ5OWljkE6OQM/sWXx0oV/OXszpp4T7oYK48eN8p+EiXH6Ajn1X4SC+IK2v1okh15/C1W/vTHeijGz60d2zOBJ9sfppCKHKXr749EumFcI3iMuFBV0tfZZN0B55/m3NuqlU2GigPp2zVUYHXkdUmZX+GChhZxjv6w= 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 1695978141097289.8303667772601; Fri, 29 Sep 2023 02:02:21 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qm9NE-0002e6-Dg; Fri, 29 Sep 2023 05:01:26 -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 1qm9N7-0002XT-4s for qemu-devel@nongnu.org; Fri, 29 Sep 2023 05:01:18 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qm9N4-0008Iv-4r for qemu-devel@nongnu.org; Fri, 29 Sep 2023 05:01:15 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-232-y2zUzpGMP8-N9sw3u07LUw-1; Fri, 29 Sep 2023 05:00:28 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 84B0C805B32; Fri, 29 Sep 2023 09:00:28 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 622A414171CA; Fri, 29 Sep 2023 09:00:28 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id E00F221E68A5; Fri, 29 Sep 2023 10:50:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695978072; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0LkSdnRNCy5pkkQ2a7BaQrKQ4x7DFab3zNu5N+cOmKc=; b=aF03NHxMo5zgNHSHgY2w5l8f3IrlsAYqdWtrMpTjGFfla87+wFSZC+N/RVj5mQlbLTsoSD UMxzoGc514DSSIQ5iQ5XbpwZOtHHnUZAzNc2qr29mbFSVyxPZ5mK+1UodwxHaICR8R19NK gghqFfmxIhZQ7VMiu6mwBsFY/JywOXI= X-MC-Unique: y2zUzpGMP8-N9sw3u07LUw-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 48/56] crypto: remove shadowed 'ret' variable Date: Fri, 29 Sep 2023 10:50:45 +0200 Message-ID: <20230929085053.2789105-49-armbru@redhat.com> In-Reply-To: <20230929085053.2789105-1-armbru@redhat.com> References: <20230929085053.2789105-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 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=170.10.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, TVD_SUBJ_WIPE_DEBT=1.004 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 @redhat.com) X-ZM-MESSAGEID: 1695978142120100003 From: Daniel P. Berrang=C3=A9 Both instances of 'ret' are used to store a gnutls API return code. Signed-off-by: Daniel P. Berrang=C3=A9 Message-ID: <20230922160644.438631-2-berrange@redhat.com> Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Markus Armbruster --- crypto/tls-cipher-suites.c | 1 - 1 file changed, 1 deletion(-) diff --git a/crypto/tls-cipher-suites.c b/crypto/tls-cipher-suites.c index 5e4f597464..d0df4badc0 100644 --- a/crypto/tls-cipher-suites.c +++ b/crypto/tls-cipher-suites.c @@ -52,7 +52,6 @@ GByteArray *qcrypto_tls_cipher_suites_get_data(QCryptoTLS= CipherSuites *obj, byte_array =3D g_byte_array_new(); =20 for (i =3D 0;; i++) { - int ret; unsigned idx; const char *name; IANA_TLS_CIPHER cipher; --=20 2.41.0 From nobody Fri May 17 11:29:14 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1695977542; cv=none; d=zohomail.com; s=zohoarc; b=URtlbCfwCqQQkc/TsQevaAo1UqLMWhlvBcimdrUJIV7T9sRz2HFj3g+oHuZzdwSHUi40NJ4lgDX1lE4qfsINWCM7b6QsXLEFF7ACGIscO3ITvz8y19D4wz2c1Uz91kqUvt5/KlibeO8l5H9RiKWjPfskuM+EjfDG7sqW9i0N9xs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695977542; 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=5OSnQuURtOEaWDZzPXgID5euxSqDLR06RTAy/I5xWro=; b=hg3uaBpl7cB72u0kkWwI+AsjfqihTqxlyGlsjnVBhv5R20x4o2BSdTxXHCSfW03Rs5DjeYjl4QPB0H/nmXFOZH8IrxoLD7t9huyd9YBAuIIRtNC+bEa6fYwaZP5dJpkwwGWrEAQgmENdTvIOamCnMjKLwB6tMWVGSCUIV+t502w= 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 1695977542165202.94246190922445; Fri, 29 Sep 2023 01:52:22 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qm9DU-00050q-0P; Fri, 29 Sep 2023 04:51:20 -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 1qm9DN-0004xt-E5 for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:14 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qm9DA-0005bv-Ph for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:11 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-163-Z0a2Tsd5NtKGD3QgQRxF_Q-1; Fri, 29 Sep 2023 04:50:58 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 03E548030A9 for ; Fri, 29 Sep 2023 08:50:58 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CB0E714171CA for ; Fri, 29 Sep 2023 08:50:57 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id E2CC121E68A6; Fri, 29 Sep 2023 10:50:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695977460; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5OSnQuURtOEaWDZzPXgID5euxSqDLR06RTAy/I5xWro=; b=cd23FgNveUtco/KFCx8Qy+aUgZiu2mmdgb+/+m3OQ9mwHD04xVoFzVigg8TjSo2ggG3uGL DZoApKu03HQ6FkfcsSiDO0RbO3FQRW6Sf69ElomgeoGpXU/oVfPNMH/1JnFInMs8xf/V7m SC8dX0MW56LLDg78XxcsPwAMdVbZnQU= X-MC-Unique: Z0a2Tsd5NtKGD3QgQRxF_Q-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 49/56] seccomp: avoid shadowing of 'action' variable Date: Fri, 29 Sep 2023 10:50:46 +0200 Message-ID: <20230929085053.2789105-50-armbru@redhat.com> In-Reply-To: <20230929085053.2789105-1-armbru@redhat.com> References: <20230929085053.2789105-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 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=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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 @redhat.com) X-ZM-MESSAGEID: 1695977544111100003 From: Daniel P. Berrang=C3=A9 This is confusing as one 'action' variable is used for storing a SCMP_ enum value, while the other 'action' variable is used for storing a SECCOMP_ enum value. Signed-off-by: Daniel P. Berrang=C3=A9 Message-ID: <20230922160644.438631-3-berrange@redhat.com> Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster --- softmmu/qemu-seccomp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/softmmu/qemu-seccomp.c b/softmmu/qemu-seccomp.c index d66a2a1226..4d7439e7f7 100644 --- a/softmmu/qemu-seccomp.c +++ b/softmmu/qemu-seccomp.c @@ -283,9 +283,9 @@ static uint32_t qemu_seccomp_update_action(uint32_t act= ion) if (action =3D=3D SCMP_ACT_TRAP) { static int kill_process =3D -1; if (kill_process =3D=3D -1) { - uint32_t action =3D SECCOMP_RET_KILL_PROCESS; + uint32_t testaction =3D SECCOMP_RET_KILL_PROCESS; =20 - if (qemu_seccomp(SECCOMP_GET_ACTION_AVAIL, 0, &action) =3D=3D = 0) { + if (qemu_seccomp(SECCOMP_GET_ACTION_AVAIL, 0, &testaction) =3D= =3D 0) { kill_process =3D 1; } else { kill_process =3D 0; --=20 2.41.0 From nobody Fri May 17 11:29:14 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1695978069; cv=none; d=zohomail.com; s=zohoarc; b=JRxfoOqFGJpiwIXfjRwcaW9BPGqYXnSMtqT0DoSKfbI3Kt81goPLJAWIYlDrdwyKG66MCObwsJWlTreUMbw5+O4VJrbwNDVuxeGOn4WyfndX1t21bRTE+yFZicvcKl3+lRFLtYTShL0Ge3v/cIdo1lQEEK80SygIoKo2OPxTEZI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695978069; 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=q39m1Z38XSXj0I2NOcQS+JuI487dqhRgCtVyZ1Wnoac=; b=DdVXcmp+3V4HVwDKtTwDNO2O5CA36nDzHJt0MdWLHx403OjVLp4QM9/F00bphd1Ic9CVxqg2pL2/GSjui8NpRL/luCbhjBx9/ad5VfeSidWmRDf3HZ7IK+RJ1IQ8HuaelWdbEC/Hkd4IJ/Tg10hxQtind3WdDmN4H6wx4A4G8bY= 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 1695978069104680.0797500497384; Fri, 29 Sep 2023 02:01:09 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qm9Mi-0001qV-2q; Fri, 29 Sep 2023 05:00:52 -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 1qm9MT-0001l7-Of for qemu-devel@nongnu.org; Fri, 29 Sep 2023 05:00:38 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qm9MM-0008BZ-JW for qemu-devel@nongnu.org; Fri, 29 Sep 2023 05:00:36 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-669-NlMusAbzOAuGMHWR05DvkQ-1; Fri, 29 Sep 2023 05:00:27 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 76D8F858F1D for ; Fri, 29 Sep 2023 09:00:27 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5380E2026D68 for ; Fri, 29 Sep 2023 09:00:27 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id E5ADD21E68A7; Fri, 29 Sep 2023 10:50:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695978029; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=q39m1Z38XSXj0I2NOcQS+JuI487dqhRgCtVyZ1Wnoac=; b=BGPvTv4at9jxwstsfeteutze0Ydo/q5ns6BdtRYj3gkeypT7C1lTIV5iL1vBd4fsFijPEh LWzqFYgUpVLlR8TqJkuU6gZPgtdIW71mqb3XA3xgX29t/hcIJU72qAbitq1L9etIHo+Yh5 BPZ57nWFKq0HZCaQn2Of9NOFIR0Nt3w= X-MC-Unique: NlMusAbzOAuGMHWR05DvkQ-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, Eric Blake , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= Subject: [PULL 50/56] qemu-nbd: changes towards enabling -Wshadow=local Date: Fri, 29 Sep 2023 10:50:47 +0200 Message-ID: <20230929085053.2789105-51-armbru@redhat.com> In-Reply-To: <20230929085053.2789105-1-armbru@redhat.com> References: <20230929085053.2789105-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 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=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.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, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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 @redhat.com) X-ZM-MESSAGEID: 1695978070999100011 From: Eric Blake Address all compiler complaints from -Wshadow in qemu-nbd. Several instances of 'int ret' became shadows when commit 4fbec260 added 'ret' at a higher scope in main. More interesting was the 'void *ret' capturing the result of a pthread; where we were conceptually doing '(void*)(intptr_t)EXIT_FAILURE !=3D NULL' which just feels wrong (even though it happens to compile correctly), so it was worth a better cleanup. Signed-off-by: Eric Blake Message-ID: <20230922205019.2755352-2-eblake@redhat.com> Reviewed-by: Daniel P. Berrang=C3=A9 Signed-off-by: Markus Armbruster --- qemu-nbd.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/qemu-nbd.c b/qemu-nbd.c index 70aa3c487a..54faa87a0c 100644 --- a/qemu-nbd.c +++ b/qemu-nbd.c @@ -939,7 +939,6 @@ int main(int argc, char **argv) g_autoptr(GError) err =3D NULL; int stderr_fd[2]; pid_t pid; - int ret; =20 if (!g_unix_open_pipe(stderr_fd, FD_CLOEXEC, &err)) { error_report("Error setting up communication pipe: %s", @@ -1172,7 +1171,6 @@ int main(int argc, char **argv) =20 if (opts.device) { #if HAVE_NBD_DEVICE - int ret; ret =3D pthread_create(&client_thread, NULL, nbd_client_thread, &o= pts); if (ret !=3D 0) { error_report("Failed to create client thread: %s", strerror(re= t)); @@ -1219,9 +1217,10 @@ int main(int argc, char **argv) qemu_opts_del(sn_opts); =20 if (opts.device) { - void *ret; - pthread_join(client_thread, &ret); - exit(ret !=3D NULL); + void *result; + pthread_join(client_thread, &result); + ret =3D (intptr_t)result; + exit(ret); } else { exit(EXIT_SUCCESS); } --=20 2.41.0 From nobody Fri May 17 11:29:14 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1695978083; cv=none; d=zohomail.com; s=zohoarc; b=dWKyfLShSZrJ0RdO0CpgO/0sAMwh4NzSuJR16P+LNp1uDN4I/EYtJrSbafHUy7iHCYADzvqg34xzPf48L5yxgH6gbfhforef0ER5YH7xoqfLj9+uPfNXff8RA4cZ+yhVvYAhcUoSsxqE2syS4KKh44zm+PGSjCj3VoVAqJf/xpE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695978083; 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=vC9UdFtw5oUsGVhmJOxImvqvigFqmtXJZT8II3cT5zU=; b=bn6JGB5Wn5sNvMqxdfDpKgLE3UHC6lB0rQsAp+IvXwZ8jnKaYgy3eRHFVZ9W0G4PAj6cw68pTPE6iYvwoqxdrBddLO8sTLFnDLEf6knY+cSm51SwsqjctOZz9VQM4gyDHB/CGB9Qu1x3L57W+i7XVmXJkZLgTNmbFRxwQ/DmRik= 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 1695978083530772.3599920743517; Fri, 29 Sep 2023 02:01:23 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qm9Mb-0001mX-1X; Fri, 29 Sep 2023 05:00:45 -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 1qm9MW-0001lu-Dj for qemu-devel@nongnu.org; Fri, 29 Sep 2023 05:00:41 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qm9MS-0008CP-F5 for qemu-devel@nongnu.org; Fri, 29 Sep 2023 05:00:40 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-583-AHSJQFTbM0a11empV89rgA-1; Fri, 29 Sep 2023 05:00:28 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 86E4D1019C92; Fri, 29 Sep 2023 09:00:28 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6465B400F3C; Fri, 29 Sep 2023 09:00:28 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id E86EC21E68A8; Fri, 29 Sep 2023 10:50:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695978034; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vC9UdFtw5oUsGVhmJOxImvqvigFqmtXJZT8II3cT5zU=; b=Y9C7a3uErcKDDgDsZlv1vUZrjO8oXdl/RgeHyXtTMlQ06SQd5Q3nNDYjxH///nk/7TBoDo IpaanQwn3IBI3wZ69ZpRfHb7auzCotBkzkUP6TRIqv7rhog5wbeAm7xv0ytaJkNn/nzoPk XYGOwMD1djph2PGtg+gdoYKRKuVk6Nc= X-MC-Unique: AHSJQFTbM0a11empV89rgA-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, Alistair Francis , Alistair Francis , Daniel Henrique Barboza Subject: [PULL 51/56] hw/riscv: opentitan: Fixup local variables shadowing Date: Fri, 29 Sep 2023 10:50:48 +0200 Message-ID: <20230929085053.2789105-52-armbru@redhat.com> In-Reply-To: <20230929085053.2789105-1-armbru@redhat.com> References: <20230929085053.2789105-1-armbru@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 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=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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 @redhat.com) X-ZM-MESSAGEID: 1695978084345100001 Content-Type: text/plain; charset="utf-8" From: Alistair Francis Local variables shadowing other local variables or parameters make the code needlessly hard to understand. Bugs love to hide in such code. Evidence: "[PATCH v3 1/7] migration/rdma: Fix save_page method to fail on polling error". This patch removes the local variable shadowing. Tested by adding: --extra-cflags=3D'-Wshadow=3Dlocal -Wno-error=3Dshadow=3Dlocal -Wno-err= or=3Dshadow=3Dcompatible-local' To configure Signed-off-by: Alistair Francis Message-ID: <20230925043023.71448-2-alistair.francis@wdc.com> Reviewed-by: Daniel Henrique Barboza Signed-off-by: Markus Armbruster --- hw/riscv/opentitan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/riscv/opentitan.c b/hw/riscv/opentitan.c index 6a2fcc4ade..436503f1ba 100644 --- a/hw/riscv/opentitan.c +++ b/hw/riscv/opentitan.c @@ -227,7 +227,7 @@ static void lowrisc_ibex_soc_realize(DeviceState *dev_s= oc, Error **errp) IRQ_M_TIMER)); =20 /* SPI-Hosts */ - for (int i =3D 0; i < OPENTITAN_NUM_SPI_HOSTS; ++i) { + for (i =3D 0; i < OPENTITAN_NUM_SPI_HOSTS; ++i) { dev =3D DEVICE(&(s->spi_host[i])); if (!sysbus_realize(SYS_BUS_DEVICE(&s->spi_host[i]), errp)) { return; --=20 2.41.0 From nobody Fri May 17 11:29:14 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1695978111; cv=none; d=zohomail.com; s=zohoarc; b=mRPjc8ZxgX0TMkPC0tPJLrnApi05tvSUpIMNedhwnosIKyE2ShjHWERfa05xODm481yScW/kyoXHWcy5plllGy6mR5+tWZ5r2ioHnKjA8iI85sYKtredhL5E3xiq8m+MRCRj/Uvpnp+niU/E+ICF2v6sdIYnk6r/H+uTMJGHoGo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695978111; 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=azgp07v5+QOdek2AunJJzRtlE9aw2NAlB9y0wTULCmo=; b=beBxUTEIVfWVYMWSxtPvuftStcBepOA3YTPZRbzRzprMj2iT+1NJt0PXnoXk5kOjXk9DK5VYD4N0OAFLUFKKYoGtcj7K2NyGUy6WSQ4M+280WaYbQHEvlXj4Txfju6uafnOchonDrQrdE94HXtHaaRjrW4pObXAFa+wvZwD4gxY= 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 1695978111931200.47929311433097; Fri, 29 Sep 2023 02:01:51 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qm9Mo-0001xv-Ut; Fri, 29 Sep 2023 05:00:58 -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 1qm9Me-0001pX-Fv for qemu-devel@nongnu.org; Fri, 29 Sep 2023 05:00:49 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qm9MP-0008C4-C1 for qemu-devel@nongnu.org; Fri, 29 Sep 2023 05:00:47 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-693-ajcrBFjKOUKr4T_r8HXm-w-1; Fri, 29 Sep 2023 05:00:28 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 86DA385A5BF; Fri, 29 Sep 2023 09:00:28 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5C54E14171B6; Fri, 29 Sep 2023 09:00:28 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id EB30421E68A9; Fri, 29 Sep 2023 10:50:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695978032; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=azgp07v5+QOdek2AunJJzRtlE9aw2NAlB9y0wTULCmo=; b=Kkf3eG0gBLdxs4zwNxQqN2NohSWV9OzRwiTBEeZpKnyGlmR7/UrsQJoEC2eXZzFuvxHajA ddKvBaLcD9TSRWpvve3VvXE3Z4XbvIK0cwYg41nNEY2OvZtJVcpbzP+L3ykTO6BG0ENCV9 xAbOBeYB5eTfqVGtKEl3QM3mV+cFlpI= X-MC-Unique: ajcrBFjKOUKr4T_r8HXm-w-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, Alistair Francis , Alistair Francis , Daniel Henrique Barboza Subject: [PULL 52/56] target/riscv: cpu: Fixup local variables shadowing Date: Fri, 29 Sep 2023 10:50:49 +0200 Message-ID: <20230929085053.2789105-53-armbru@redhat.com> In-Reply-To: <20230929085053.2789105-1-armbru@redhat.com> References: <20230929085053.2789105-1-armbru@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 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=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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 @redhat.com) X-ZM-MESSAGEID: 1695978114134100003 Content-Type: text/plain; charset="utf-8" From: Alistair Francis Local variables shadowing other local variables or parameters make the code needlessly hard to understand. Bugs love to hide in such code. Evidence: "[PATCH v3 1/7] migration/rdma: Fix save_page method to fail on polling error". This patch removes the local variable shadowing. Tested by adding: --extra-cflags=3D'-Wshadow=3Dlocal -Wno-error=3Dshadow=3Dlocal -Wno-err= or=3Dshadow=3Dcompatible-local' To configure Signed-off-by: Alistair Francis Message-ID: <20230925043023.71448-3-alistair.francis@wdc.com> Reviewed-by: Daniel Henrique Barboza Signed-off-by: Markus Armbruster --- target/riscv/cpu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index f227c7664e..4140899c52 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -704,7 +704,7 @@ static void riscv_cpu_dump_state(CPUState *cs, FILE *f,= int flags) CSR_MPMMASK, }; =20 - for (int i =3D 0; i < ARRAY_SIZE(dump_csrs); ++i) { + for (i =3D 0; i < ARRAY_SIZE(dump_csrs); ++i) { int csrno =3D dump_csrs[i]; target_ulong val =3D 0; RISCVException res =3D riscv_csrrw_debug(env, csrno, &val, 0, = 0); @@ -747,7 +747,7 @@ static void riscv_cpu_dump_state(CPUState *cs, FILE *f,= int flags) CSR_VTYPE, CSR_VLENB, }; - for (int i =3D 0; i < ARRAY_SIZE(dump_rvv_csrs); ++i) { + for (i =3D 0; i < ARRAY_SIZE(dump_rvv_csrs); ++i) { int csrno =3D dump_rvv_csrs[i]; target_ulong val =3D 0; RISCVException res =3D riscv_csrrw_debug(env, csrno, &val, 0, = 0); --=20 2.41.0 From nobody Fri May 17 11:29:14 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1695978066; cv=none; d=zohomail.com; s=zohoarc; b=ZcJtQThOfKJb/1rjMSlV4zAkNG6PsUhShiHZCJ2GfJxQA8s/m7rRn8WunBHQuY1Ali2U5PxBwuBFScG6OrHTyqX1W4+hUlNQQwtRnNs1Jz8yWCq9OtGSPy7pVWfVclTozpHv7pulnzY/K9S63ojcb7sSslW+1HTXKgsuIX208CY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695978066; 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=MovP6uA9rAExPQL+1e2QSD2zaYRa2z2+ns2RMsw7fak=; b=GnPJS2ITOSaP5enLxvdMO0doiwUzNQ7OlFg+bXAsck+IJN+XlnpBeVSS0HjzEXwujw7boQmyqI10TpS5tglVcMnqTzgPrTy3e8ODemF4YEzaXFP7YhymFbr+9rPUX8HnzOQ6gn3eij5DeBGJVkcRjJj3Ona30zoez3xmK+fHzpw= 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 1695978066696857.6194007723753; Fri, 29 Sep 2023 02:01:06 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qm9Mq-0001z8-Nj; Fri, 29 Sep 2023 05:01: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 1qm9Mf-0001q0-F3 for qemu-devel@nongnu.org; Fri, 29 Sep 2023 05:00:50 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qm9MP-0008C6-Br for qemu-devel@nongnu.org; Fri, 29 Sep 2023 05:00:49 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-583-gFInJY1DMNiSHWw9YMepnQ-1; Fri, 29 Sep 2023 05:00:28 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 84E73805BA7; Fri, 29 Sep 2023 09:00:28 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5F630492B05; Fri, 29 Sep 2023 09:00:28 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id EDFC621E68AA; Fri, 29 Sep 2023 10:50:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695978032; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MovP6uA9rAExPQL+1e2QSD2zaYRa2z2+ns2RMsw7fak=; b=SDbUdTD32TyltWU8jgqVpoywEgmKWajrr0ckOBVWh8lvz3gaQ4BtK4UTUvA05HhaH+6zqa ft+KRDnXcbLIa49Odpqayoj3nixMBWdJVsHbDCw07og86JZQ8VzAZzMqqCfhM1LAAVNz/R m9VXf68fdDr74gNjN6X+u4UXAhMJr3A= X-MC-Unique: gFInJY1DMNiSHWw9YMepnQ-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, Alistair Francis , Alistair Francis , Daniel Henrique Barboza Subject: [PULL 53/56] target/riscv: vector_helper: Fixup local variables shadowing Date: Fri, 29 Sep 2023 10:50:50 +0200 Message-ID: <20230929085053.2789105-54-armbru@redhat.com> In-Reply-To: <20230929085053.2789105-1-armbru@redhat.com> References: <20230929085053.2789105-1-armbru@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 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=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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 @redhat.com) X-ZM-MESSAGEID: 1695978068059100001 Content-Type: text/plain; charset="utf-8" From: Alistair Francis Local variables shadowing other local variables or parameters make the code needlessly hard to understand. Bugs love to hide in such code. Evidence: "[PATCH v3 1/7] migration/rdma: Fix save_page method to fail on polling error". This patch removes the local variable shadowing. Tested by adding: --extra-cflags=3D'-Wshadow=3Dlocal -Wno-error=3Dshadow=3Dlocal -Wno-err= or=3Dshadow=3Dcompatible-local' To configure Signed-off-by: Alistair Francis Message-ID: <20230925043023.71448-4-alistair.francis@wdc.com> Reviewed-by: Daniel Henrique Barboza Signed-off-by: Markus Armbruster --- target/riscv/vector_helper.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/target/riscv/vector_helper.c b/target/riscv/vector_helper.c index 3fb05cc3d6..cba02c1320 100644 --- a/target/riscv/vector_helper.c +++ b/target/riscv/vector_helper.c @@ -516,7 +516,7 @@ ProbeSuccess: k++; continue; } - target_ulong addr =3D base + ((i * nf + k) << log2_esz); + addr =3D base + ((i * nf + k) << log2_esz); ldst_elem(env, adjust_addr(env, addr), i + k * max_elems, vd, = ra); k++; } @@ -4791,9 +4791,10 @@ void HELPER(NAME)(void *vd, void *v0, target_ulong s= 1, void *vs2, \ uint32_t total_elems =3D vext_get_total_elems(env, desc, esz); = \ uint32_t vta =3D vext_vta(desc); = \ uint32_t vma =3D vext_vma(desc); = \ - target_ulong i_max, i; \ + target_ulong i_max, i_min, i; \ \ - i_max =3D MAX(MIN(s1 < vlmax ? vlmax - s1 : 0, vl), env->vstart); = \ + i_min =3D MIN(s1 < vlmax ? vlmax - s1 : 0, vl); = \ + i_max =3D MAX(i_min, env->vstart); = \ for (i =3D env->vstart; i < i_max; ++i) { = \ if (!vm && !vext_elem_mask(v0, i)) { \ /* set masked-off elements to 1s */ \ --=20 2.41.0 From nobody Fri May 17 11:29:14 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1695978102; cv=none; d=zohomail.com; s=zohoarc; b=hQSla5IA8hKuz51zq6lc3twjSGr4dvykpQApHKkbLfHa+9ANmRwvtpw7MqYCg7FgEXiWwmGqrNGZfCjEE1MzwySHtmEQmASY6Iaz8p9CSuJoGFYYhrRPSLysXip3mmdqEVyrknFwtcy7pfOYYb6xS6vJMhu663pYWh3KBWzl24U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695978102; 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=LHh7saVQdWDK6D2YuWCRZebWE9RyLsEb07FXutwk9n8=; b=V6UUlCArp3j2wWEKbiptupvj46Di0v7M1+s4w5ci2oEHos92ujTtIkIeJgR39Z7O17Z8MTfVUlfl4AYUMWYG3Kk23y+6S7WGhkiBT0/KGBxwvxf+kkWQ/XwrXcoJ3oHdAJcgiI5QlQniM77gYz94NsgsRcJW35/CuVJbpti1VP0= 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 1695978102554834.227968296657; Fri, 29 Sep 2023 02:01:42 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qm9Mn-0001wJ-H8; Fri, 29 Sep 2023 05:00:57 -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 1qm9MV-0001lf-1Q for qemu-devel@nongnu.org; Fri, 29 Sep 2023 05:00:41 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qm9MP-0008CF-Rl for qemu-devel@nongnu.org; Fri, 29 Sep 2023 05:00:38 -0400 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-693-Nvr_bfRJPY-Zj4gcxJ7jxg-1; Fri, 29 Sep 2023 05:00:28 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8D2F31DD35D1; Fri, 29 Sep 2023 09:00:28 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6B5F349BB9A; Fri, 29 Sep 2023 09:00:28 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id F0DFE21E68AB; Fri, 29 Sep 2023 10:50:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695978033; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LHh7saVQdWDK6D2YuWCRZebWE9RyLsEb07FXutwk9n8=; b=FVnfQBZwoVQ5BHZKlOTjVgliKEkmUsZGZNQILC5wzSPGU2wNAkuCfT/CVPCM4sLediz0dM PBYfjJJMVBXg8BHtmDbq2yT6sjCfQuOgjoSGhnltW3NSF356Dp17yhDFXlx7HonRv8Fr8B OJLSUCS8aOLfzBj65bQ8Od0eSOt0XZg= X-MC-Unique: Nvr_bfRJPY-Zj4gcxJ7jxg-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, Alistair Francis , Alistair Francis , Daniel Henrique Barboza Subject: [PULL 54/56] softmmu/device_tree: Fixup local variables shadowing Date: Fri, 29 Sep 2023 10:50:51 +0200 Message-ID: <20230929085053.2789105-55-armbru@redhat.com> In-Reply-To: <20230929085053.2789105-1-armbru@redhat.com> References: <20230929085053.2789105-1-armbru@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 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=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, 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 @redhat.com) X-ZM-MESSAGEID: 1695978103294100003 Content-Type: text/plain; charset="utf-8" From: Alistair Francis Local variables shadowing other local variables or parameters make the code needlessly hard to understand. Bugs love to hide in such code. Evidence: "[PATCH v3 1/7] migration/rdma: Fix save_page method to fail on polling error". This patch removes the local variable shadowing. Tested by adding: --extra-cflags=3D'-Wshadow=3Dlocal -Wno-error=3Dshadow=3Dlocal -Wno-err= or=3Dshadow=3Dcompatible-local' To configure Signed-off-by: Alistair Francis Message-ID: <20230925043023.71448-5-alistair.francis@wdc.com> Reviewed-by: Daniel Henrique Barboza Signed-off-by: Markus Armbruster --- softmmu/device_tree.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/softmmu/device_tree.c b/softmmu/device_tree.c index 30aa3aea9f..eb5166ca36 100644 --- a/softmmu/device_tree.c +++ b/softmmu/device_tree.c @@ -418,9 +418,9 @@ int qemu_fdt_setprop_string_array(void *fdt, const char= *node_path, } p =3D str =3D g_malloc0(total_len); for (i =3D 0; i < len; i++) { - int len =3D strlen(array[i]) + 1; - pstrcpy(p, len, array[i]); - p +=3D len; + int offset =3D strlen(array[i]) + 1; + pstrcpy(p, offset, array[i]); + p +=3D offset; } =20 ret =3D qemu_fdt_setprop(fdt, node_path, prop, str, total_len); --=20 2.41.0 From nobody Fri May 17 11:29:14 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1695978069; cv=none; d=zohomail.com; s=zohoarc; b=SQ4Eulz1/S/JAKj5Db0a31PYc8LtdWyjMK7fTcGsRRpEZeFPBmZnSeT4uBSimNlvHEMpvBPXu5fKhUEBygOLH092HcCKsCUmRaABP57TcNyB2G5JrVL9Cd3X40qp+NNAJPANCSig3m7pe0kTsJwpg5VaP5mY6t73GkSmgJHtZGQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695978069; 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=fuyo5yYtGJxUI4HalBHeJ6YEV/j2IPp/nq6KI3/C+Ac=; b=frHZq7Hu4FFMCVTAbmPO1CHI25OyaVSStsFcvofBaFc0Zxta5W3MHhtGiXHmufiSzSN9edVQccaKXgRC+fVwk9W1KIEOjijmhP9lXHx4Cxtxp672tXu2wZ8Z5weM6NKfbK6Zi/LBwflk0WZqvUKVr/+y5b7x/ZIunisFWUavDms= 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 169597806961945.55042222591169; Fri, 29 Sep 2023 02:01:09 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qm9Mc-0001n7-E5; Fri, 29 Sep 2023 05:00:46 -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 1qm9MT-0001l8-QQ for qemu-devel@nongnu.org; Fri, 29 Sep 2023 05:00:38 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qm9MP-0008CA-Jq for qemu-devel@nongnu.org; Fri, 29 Sep 2023 05:00:37 -0400 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-232-mZU6g1TtPz6t2Vuuczh-Bw-1; Fri, 29 Sep 2023 05:00:28 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9A8801DD35D3; Fri, 29 Sep 2023 09:00:28 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 757E2492B16; Fri, 29 Sep 2023 09:00:28 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id F3BB921E68AC; Fri, 29 Sep 2023 10:50:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695978033; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=fuyo5yYtGJxUI4HalBHeJ6YEV/j2IPp/nq6KI3/C+Ac=; b=WA1hbI8wC0sKYaJnXzu1Mhn79jhozZMzq8TMam/Bi/6zGniMVwhcItKpM9SvcKrH6cY4Lu 0LQMzr4or51pZ0qaADFJDlqrRlTM9SVCDCCorDywd2R8gxgMRHpT7FJF2ROcKvTSxOc4le tEHpjtd/+DQ3w2uAhGVq19/IfozgVjU= X-MC-Unique: mZU6g1TtPz6t2Vuuczh-Bw-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, Klaus Jensen , Jesper Wendel Devantier Subject: [PULL 55/56] hw/nvme: Clean up local variable shadowing in nvme_ns_init() Date: Fri, 29 Sep 2023 10:50:52 +0200 Message-ID: <20230929085053.2789105-56-armbru@redhat.com> In-Reply-To: <20230929085053.2789105-1-armbru@redhat.com> References: <20230929085053.2789105-1-armbru@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 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=170.10.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, 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 @redhat.com) X-ZM-MESSAGEID: 1695978070615100005 Content-Type: text/plain; charset="utf-8" From: Klaus Jensen Fix local variable shadowing in nvme_ns_init(). Reported-by: Markus Armbruster Signed-off-by: Klaus Jensen Message-ID: <20230925-fix-local-shadowing-v1-1-3a1172132377@samsung.com> Reviewed-by: Jesper Wendel Devantier Signed-off-by: Markus Armbruster --- hw/nvme/ns.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/nvme/ns.c b/hw/nvme/ns.c index 44aba8f4d9..0eabcf5cf5 100644 --- a/hw/nvme/ns.c +++ b/hw/nvme/ns.c @@ -107,7 +107,7 @@ static int nvme_ns_init(NvmeNamespace *ns, Error **errp) =20 ns->pif =3D ns->params.pif; =20 - static const NvmeLBAF lbaf[16] =3D { + static const NvmeLBAF defaults[16] =3D { [0] =3D { .ds =3D 9 }, [1] =3D { .ds =3D 9, .ms =3D 8 }, [2] =3D { .ds =3D 9, .ms =3D 16 }, @@ -120,7 +120,7 @@ static int nvme_ns_init(NvmeNamespace *ns, Error **errp) =20 ns->nlbaf =3D 8; =20 - memcpy(&id_ns->lbaf, &lbaf, sizeof(lbaf)); + memcpy(&id_ns->lbaf, &defaults, sizeof(defaults)); =20 for (i =3D 0; i < ns->nlbaf; i++) { NvmeLBAF *lbaf =3D &id_ns->lbaf[i]; --=20 2.41.0 From nobody Fri May 17 11:29:14 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1695978054; cv=none; d=zohomail.com; s=zohoarc; b=Ylo0rmPH2bupk7nsqpqq8YQu4ut+Kt7h2whyUnz949cNi8JMdY/m31Ql6rGJACjI9HDuTkYXd1SQkjw2l9qIk/e3ECEaWYWE3C+QQmb5MfCj8Ylvrou2ZdyA8aQxK86af0bt8r8PgzBMPDcdw0DI7VP2nhtPi/wbfPX5tbUhqTo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695978054; 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=sV+DtGi84HPssSVzgO+VJii6jHcfwF9uixmboeibk2Y=; b=BhV1Eaq18qmR5gHnA18MY2JJKSMz9XWIO5LoykcFlQQYx/a1qTMLHtsLv44beiPkDlIaKWClMKygLbXAkMas+tGEAqXsG8JlyXHawRes20oiSSbccYcJemhPSLqcsJ+TZWtT7wWhJdaK7lhPioRv5aWmMYwaCEPtbyCTJ18gzb4= 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 1695978054842141.90061518796392; Fri, 29 Sep 2023 02:00:54 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qm9Ma-0001mP-Dv; Fri, 29 Sep 2023 05:00:44 -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 1qm9MT-0001iF-O3 for qemu-devel@nongnu.org; Fri, 29 Sep 2023 05:00:38 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qm9MN-0008BW-8L for qemu-devel@nongnu.org; Fri, 29 Sep 2023 05:00:36 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-689-FE4UdF2RN7qt9JweQt_ZYg-1; Fri, 29 Sep 2023 05:00:27 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7A857858281; Fri, 29 Sep 2023 09:00:27 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4D02C2026D4B; Fri, 29 Sep 2023 09:00:27 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 0266621E68AD; Fri, 29 Sep 2023 10:50:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695978029; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sV+DtGi84HPssSVzgO+VJii6jHcfwF9uixmboeibk2Y=; b=aWyim2Me5abiL1G8+Y+V0RfAaxfln9me9KbMCuPDNqTAlFGfol6MhL9hKSN0SnJENRJDiq niLAg49VivC6ihhqs1ttBh7Jx/i8nYRwn5J+o4iXVr3QD/FVOvee5ntO9+J3NdTICyYMvQ DxF09gMLIIKrqUGMCJ1tSCCH+c3Pkbo= X-MC-Unique: FE4UdF2RN7qt9JweQt_ZYg-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, Laurent Vivier , Thomas Huth Subject: [PULL 56/56] disas/m68k: clean up local variable shadowing Date: Fri, 29 Sep 2023 10:50:53 +0200 Message-ID: <20230929085053.2789105-57-armbru@redhat.com> In-Reply-To: <20230929085053.2789105-1-armbru@redhat.com> References: <20230929085053.2789105-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 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=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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 @redhat.com) X-ZM-MESSAGEID: 1695978055705100003 From: Laurent Vivier Fix following warnings .../disas/m68k.c: In function =E2=80=98print_insn_arg=E2=80=99: .../disas/m68k.c:1635:13: warning: declaration of =E2=80=98val=E2=80=99 sha= dows a previous local [-Wshadow=3Dcompatible-local] 1635 | int val =3D fetch_arg (buffer, place, 5, info); | ^~~ .../disas/m68k.c:1093:7: note: shadowed declaration is here 1093 | int val =3D 0; | ^~~ Signed-off-by: Laurent Vivier Message-ID: <20230925084455.395150-1-laurent@vivier.eu> Reviewed-by: Thomas Huth Signed-off-by: Markus Armbruster --- disas/m68k.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/disas/m68k.c b/disas/m68k.c index aefaecfbd6..1f16e295ab 100644 --- a/disas/m68k.c +++ b/disas/m68k.c @@ -1632,10 +1632,10 @@ print_insn_arg (const char *d, case '2': case '3': { - int val =3D fetch_arg (buffer, place, 5, info); + int reg =3D fetch_arg (buffer, place, 5, info); const char *name =3D 0; =20 - switch (val) + switch (reg) { case 2: name =3D "%tt0"; break; case 3: name =3D "%tt1"; break; @@ -1655,12 +1655,12 @@ print_insn_arg (const char *d, int break_reg =3D ((buffer[3] >> 2) & 7); =20 (*info->fprintf_func) - (info->stream, val =3D=3D 0x1c ? "%%bad%d" : "%%bac%d", + (info->stream, reg =3D=3D 0x1c ? "%%bad%d" : "%%bac%d", break_reg); } break; default: - (*info->fprintf_func) (info->stream, "", val); + (*info->fprintf_func) (info->stream, "", reg); } if (name) (*info->fprintf_func) (info->stream, "%s", name); --=20 2.41.0