From nobody Sat May 18 15:08:28 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=1696592467; cv=none; d=zohomail.com; s=zohoarc; b=OW1XaArmOMEQN9rXt3Dgv8akZ+F0/Zf3dNc/q8jBJILb9JHOhHIS3KJC0o1rdNSHXc2N53P67ZIHASqAhx+s/rm6HQBl3pn2+QVfHFKBlD/6cCMbNHqbO0OOs8HxkxCux5j3lRHYZu0ePQHIzR6lUUeFO1gVPz313vPt8B1OJ4s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696592467; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=e4JdFg0j6H7ycjx9uGtGzNYrdJ5pAy9j34KWsSIoLwI=; b=kkV7BtktLtAgFNn6ugJMQqOsbIQRB3UzxqVIptkaSB996P+167aPywV5v1JiEEem5ZasiPZ3grFT3eL80NxA7M7ayLrWrq+bqU1ZbHH9KgjSlSV+KheYNxNgDRYlOvu70k18cux1CSur+ifCapYKM3xWqQ5AqYgXrFMOugGvgRQ= 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 1696592467174844.6996411758804; Fri, 6 Oct 2023 04:41:07 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoj9I-00057V-7z; Fri, 06 Oct 2023 07:37: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 1qoj8q-0004zp-LN for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37: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 1qoj8k-00007H-HM for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37: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-300-8y--2nizP06o3-DZCyeFyw-1; Fri, 06 Oct 2023 07:36:59 -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 B4FE829A9D38; Fri, 6 Oct 2023 11:36:58 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 62E3640C6EA8; Fri, 6 Oct 2023 11:36:58 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 578E421E6905; Fri, 6 Oct 2023 13:36:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696592223; 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=e4JdFg0j6H7ycjx9uGtGzNYrdJ5pAy9j34KWsSIoLwI=; b=PKJHQSKWgj7101pXxCx61DD+MZVVd91Mkwn/My7WWhQw+yUaAYhDVqaQA6apWTcy1u1YOU F9a/3Xk01VPh5Mn2h5mcyW+TlfyLpFR5DAKT5Gy6pIdCreH/LjUpPaN26p6p5+8Rx/EFc9 vMm68dhzYfVjrQolxUFLAZ4ngIhjdXw= X-MC-Unique: 8y--2nizP06o3-DZCyeFyw-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, Jonathan Cameron , "Michael S . Tsirkin" , Fan Ni Subject: [PULL 01/32] hw/cxl: Fix local variable shadowing of cap_hdrs Date: Fri, 6 Oct 2023 13:36:26 +0200 Message-ID: <20231006113657.3803180-2-armbru@redhat.com> In-Reply-To: <20231006113657.3803180-1-armbru@redhat.com> References: <20231006113657.3803180-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.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: 1696592468601100003 Content-Type: text/plain; charset="utf-8" From: Jonathan Cameron Rename the version not burried in the macro to cap_h. Signed-off-by: Jonathan Cameron Message-ID: <20230925152258.5444-1-Jonathan.Cameron@huawei.com> Reviewed-by: Michael S. Tsirkin Reviewed-by: Fan Ni Signed-off-by: Markus Armbruster --- hw/cxl/cxl-device-utils.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/cxl/cxl-device-utils.c b/hw/cxl/cxl-device-utils.c index 517f06d869..bd68328032 100644 --- a/hw/cxl/cxl-device-utils.c +++ b/hw/cxl/cxl-device-utils.c @@ -283,13 +283,13 @@ static void memdev_reg_init_common(CXLDeviceState *cx= l_dstate) { } =20 void cxl_device_register_init_common(CXLDeviceState *cxl_dstate) { - uint64_t *cap_hdrs =3D cxl_dstate->caps_reg_state64; + uint64_t *cap_h =3D cxl_dstate->caps_reg_state64; const int cap_count =3D 3; =20 /* CXL Device Capabilities Array Register */ - ARRAY_FIELD_DP64(cap_hdrs, CXL_DEV_CAP_ARRAY, CAP_ID, 0); - ARRAY_FIELD_DP64(cap_hdrs, CXL_DEV_CAP_ARRAY, CAP_VERSION, 1); - ARRAY_FIELD_DP64(cap_hdrs, CXL_DEV_CAP_ARRAY, CAP_COUNT, cap_count); + ARRAY_FIELD_DP64(cap_h, CXL_DEV_CAP_ARRAY, CAP_ID, 0); + ARRAY_FIELD_DP64(cap_h, CXL_DEV_CAP_ARRAY, CAP_VERSION, 1); + ARRAY_FIELD_DP64(cap_h, CXL_DEV_CAP_ARRAY, CAP_COUNT, cap_count); =20 cxl_device_cap_init(cxl_dstate, DEVICE_STATUS, 1, 2); device_reg_init_common(cxl_dstate); --=20 2.41.0 From nobody Sat May 18 15:08:28 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=1696592533; cv=none; d=zohomail.com; s=zohoarc; b=jbYKkA3spYyVXJbdq1xjpzdSbLlQkB101bKtO7RW92ccFPe1ZnTuqInjdhiwj1VR2jVUytuV3vFUXUMzft3aPWEYmyj5l54V1cnIgAjZJkLsB6SPhzIIzTz7q9IwYDS2u/453+eigEnB9EGysXb/836GXLGVes5dDCbRKvOPfqA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696592533; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=qW08Olq4UoAHUHxq4PoCzLDhmdF8g+VsBUPw+dgUIlU=; b=Mk0e7KL/nBcchKKCJSbHVfco9si8JuNa/ZJSr8YASt5pj2OHzleBATweCH6vY7yps2vwAlpApkAhoDsXWGm+HiV3T0DpIj3nxLhsPFTbLFVUtnNqrpt2nz0DbH6XkRSyHTBq6RE25Hf0wHKfyfc9Kh3FbOS5AZ+svfIaqodPhzs= 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 1696592533918617.3503026162508; Fri, 6 Oct 2023 04:42:13 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoj9L-0005AB-Dv; Fri, 06 Oct 2023 07:37:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qoj8x-00051u-15 for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37:19 -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 1qoj8t-00006h-88 for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37:18 -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-529-HUqCcvz7Nj-ABCFPW0T0pA-1; Fri, 06 Oct 2023 07:36:59 -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 CBCD2800969; Fri, 6 Oct 2023 11:36:58 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AB4241054FC1; Fri, 6 Oct 2023 11:36:58 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 5A89E21E6906; Fri, 6 Oct 2023 13:36:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696592221; 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=qW08Olq4UoAHUHxq4PoCzLDhmdF8g+VsBUPw+dgUIlU=; b=WNA8mwBXVPYLApCUU1+kh+JOue7OD1tsNcvwaQ+WMT4MaaSLIDwECVPsjkX30NhDhmLtOu vkcykUkkfQ5pg9OavojucIZOAe7eYWU9pHbEfXbujd7Vmoqlf7g0Jw4TaMiWqsd0CTPN4n ofKUST+7j2KuDBrhvhcMA2p9Ze52j8Y= X-MC-Unique: HUqCcvz7Nj-ABCFPW0T0pA-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, Song Gao Subject: [PULL 02/32] target/loongarch: Clean up local variable shadowing Date: Fri, 6 Oct 2023 13:36:27 +0200 Message-ID: <20231006113657.3803180-3-armbru@redhat.com> In-Reply-To: <20231006113657.3803180-1-armbru@redhat.com> References: <20231006113657.3803180-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: 1696592535944100005 Content-Type: text/plain; charset="utf-8" From: Song Gao Fix: [1839/2601] Compiling C object libqemu-loongarch64-softmmu.fa.p/hw_loonga= rch_virt.c.o ../hw/loongarch/virt.c: In function 'loongarch_irq_init': ../hw/loongarch/virt.c:665:14: warning: declaration of 'i' shadows a prev= ious local [-Wshadow=3Dcompatible-local] for (int i =3D 0; i < num; i++) { ^ ../hw/loongarch/virt.c:582:19: note: shadowed declaration is here int cpu, pin, i, start, num; Signed-off-by: Song Gao Message-ID: <20230926071253.3601021-1-gaosong@loongson.cn> Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster --- hw/loongarch/virt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index 2629128aed..b0a004f860 100644 --- a/hw/loongarch/virt.c +++ b/hw/loongarch/virt.c @@ -662,7 +662,7 @@ static void loongarch_irq_init(LoongArchMachineState *l= ams) sysbus_mmio_get_region(d, 2)); =20 /* Connect pch_pic irqs to extioi */ - for (int i =3D 0; i < num; i++) { + for (i =3D 0; i < num; i++) { qdev_connect_gpio_out(DEVICE(d), i, qdev_get_gpio_in(extioi, i)); } =20 --=20 2.41.0 From nobody Sat May 18 15:08:28 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=1696592350; cv=none; d=zohomail.com; s=zohoarc; b=R+FY7J21bXzTdJUe5Kv9DeUm7wovmpCjkwlsGphdEZVih4mXzxackhJJ3WC/qiZayM86fZ8w+0VKER1zoxq8/UukNCeY9mOO8hLfBKyQ/uynqCS2rjTnMrfr1CUE9+mlNfoiykoWp7CSeEp3152TuteM7d7yCA5ir30A0qF7+k8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696592350; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Gx49RQwNuraS/UYpmM3v82biY3hwQbEu08fblmGBqMg=; b=Yayg2HljdUjK0nRI/S2iT0uX0kvNseG2Fnn+ZpM/O73r+B7t2nCKeEBHNKChuTLJryzNEjrThV05xh4Y82af+EelJII2unEMjR0kkdv1eA1uelPAj/FPHfl54nirZgSnnlx+zAGKFQVTYAgr/QwXR3+e8iYlabwBHQPTjfWixNA= 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 1696592350568262.9443160393279; Fri, 6 Oct 2023 04:39:10 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoj9I-00058E-Vq; Fri, 06 Oct 2023 07:37: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 1qoj8w-00051n-Cl for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37: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 1qoj8t-00009r-5X for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37: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-300-yhrStZ2PPJGgCoDGwrICSw-1; Fri, 06 Oct 2023 07:36: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 84C001C06375; Fri, 6 Oct 2023 11:36:58 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 634041054FC1; Fri, 6 Oct 2023 11:36:58 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 5D65221E690B; Fri, 6 Oct 2023 13:36:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696592231; 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=Gx49RQwNuraS/UYpmM3v82biY3hwQbEu08fblmGBqMg=; b=CS6LkZ2gg8TRvSqb7pSQ+PYJApVrIVqBwm9fCkwovTMmPDAKRZVXaIfibrE78R0dEj+STG VqcRTFgHRj4QXYIqNPlAQdiTLUKzgLh4wlAXg/RWuCbL+f46G/8iwad6gpcS2yZnH/FCf2 3HxxmhSn9TE9KK926jLiC4+tOIydxhc= X-MC-Unique: yhrStZ2PPJGgCoDGwrICSw-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Michael Tokarev Subject: [PULL 03/32] target/ppc: Rename variables to avoid local variable shadowing in VUPKPX Date: Fri, 6 Oct 2023 13:36:28 +0200 Message-ID: <20231006113657.3803180-4-armbru@redhat.com> In-Reply-To: <20231006113657.3803180-1-armbru@redhat.com> References: <20231006113657.3803180-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.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: 1696592352374100017 From: C=C3=A9dric Le Goater and fix such warnings : ../target/ppc/int_helper.c: In function =E2=80=98helper_vupklpx=E2=80=99: ../target/ppc/int_helper.c:2025:21: warning: declaration of =E2=80=98r=E2= =80=99 shadows a parameter [-Wshadow=3Dlocal] 2025 | uint8_t r =3D (e >> 10) & 0x1f; = \ | ^ ../target/ppc/int_helper.c:2033:1: note: in expansion of macro =E2=80=98V= UPKPX=E2=80=99 2033 | VUPKPX(lpx, UPKLO) | ^~~~~~ ../target/ppc/int_helper.c:2017:41: note: shadowed declaration is here 2017 | void helper_vupk##suffix(ppc_avr_t *r, ppc_avr_t *b) = \ | ~~~~~~~~~~~^ ../target/ppc/int_helper.c:2033:1: note: in expansion of macro =E2=80=98V= UPKPX=E2=80=99 2033 | VUPKPX(lpx, UPKLO) | ^~~~~~ Signed-off-by: C=C3=A9dric Le Goater Message-ID: <20230929083143.234553-1-clg@kaod.org> Reviewed-by: Michael Tokarev Signed-off-by: Markus Armbruster --- target/ppc/int_helper.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/target/ppc/int_helper.c b/target/ppc/int_helper.c index 6fd00684a5..0a5c3e78a4 100644 --- a/target/ppc/int_helper.c +++ b/target/ppc/int_helper.c @@ -2020,13 +2020,13 @@ void helper_vsum4ubs(CPUPPCState *env, ppc_avr_t *r= , ppc_avr_t *a, ppc_avr_t *b) ppc_avr_t result; \ \ for (i =3D 0; i < ARRAY_SIZE(r->u32); i++) { \ - uint16_t e =3D b->u16[hi ? i : i + 4]; \ - uint8_t a =3D (e >> 15) ? 0xff : 0; \ - uint8_t r =3D (e >> 10) & 0x1f; \ - uint8_t g =3D (e >> 5) & 0x1f; \ - uint8_t b =3D e & 0x1f; \ + uint16_t _e =3D b->u16[hi ? i : i + 4]; \ + uint8_t _a =3D (_e >> 15) ? 0xff : 0; \ + uint8_t _r =3D (_e >> 10) & 0x1f; \ + uint8_t _g =3D (_e >> 5) & 0x1f; \ + uint8_t _b =3D _e & 0x1f; \ \ - result.u32[i] =3D (a << 24) | (r << 16) | (g << 8) | b; \ + result.u32[i] =3D (_a << 24) | (_r << 16) | (_g << 8) | _b; \ } \ *r =3D result; \ } --=20 2.41.0 From nobody Sat May 18 15:08:28 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=1696592571; cv=none; d=zohomail.com; s=zohoarc; b=HIhlDiCmY3xlmSLp9e1dhA8yYEYSGdztTUVtDS3RIn3AyaAzhF5VSZQ/whPqU4Z472GkUq3mjhGTxsQrgNclH/wtjwNOquNDGXOUYyuMCTu8H4iaMa0N35Xzzk8t2ThGpRbZtWqGViGMrp42VswxRRljvL47Q/RFC2063AmQ8uI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696592571; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=5OeUd6hJ67CdwRoUSGaWoyHSJmlOicoM8LgafBXjW9U=; b=HHzYX7LSWPwSAbPSqGG+0cOP0scyQk6LEHwkLfHA8VtkuhAkdZ18vdwSXk5IbIaONmS7o7oxQaXbNjV/+uRZdhYEQIksJAs7mED8EYpNGt2V+i0xgDQTSX2ku+pY2Ba5ME/NvOSV/F0cHzOa5oqdsXpBTGUQ7Kv7b8f5+l7OoxM= 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 1696592571052742.8229462178722; Fri, 6 Oct 2023 04:42:51 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoj9T-0005CZ-0M; Fri, 06 Oct 2023 07:37:51 -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 1qoj91-000535-4O for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37:24 -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 1qoj8t-0000B2-Vk for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37: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-300-q_34OTWnM1qFErINUE9ZgA-1; Fri, 06 Oct 2023 07:36: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 891BF801E91; Fri, 6 Oct 2023 11:36:58 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 680C120268C8; Fri, 6 Oct 2023 11:36:58 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 606F421E690C; Fri, 6 Oct 2023 13:36:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696592235; 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=5OeUd6hJ67CdwRoUSGaWoyHSJmlOicoM8LgafBXjW9U=; b=eeVOCEdP3O2HTR1FvD/B9b4S/Dd4CfrCYBYYUwwLDjB2BjE1XQrL8Ytu8llUJDn4ul1xI1 EBg2elqbFvQ9xRiLokQjwNR+ImmncT4RE0UCJ4iUZThIOEfU9TAeP0b4MTHUAeExxiFHa+ NjnHk3lLhIPac90vEccsUdSvBxk2zH8= X-MC-Unique: q_34OTWnM1qFErINUE9ZgA-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, Ani Sinha , Philippe Mathieu-Daude , mst@redhat.com, =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= , Peter Xu Subject: [PULL 04/32] hw/i386: changes towards enabling -Wshadow=local for x86 machines Date: Fri, 6 Oct 2023 13:36:29 +0200 Message-ID: <20231006113657.3803180-5-armbru@redhat.com> In-Reply-To: <20231006113657.3803180-1-armbru@redhat.com> References: <20231006113657.3803180-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, 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: 1696592572899100011 From: Ani Sinha Code changes that addresses all compiler complaints coming from enabling -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 CC: Markus Armbruster CC: Philippe Mathieu-Daude CC: mst@redhat.com Signed-off-by: Ani Sinha Reviewed-by: Daniel P. Berrang=C3=A9 Reviewed-by: Peter Xu Message-ID: <20231003102803.6163-1-anisinha@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Markus Armbruster --- hw/i386/acpi-microvm.c | 4 ++-- hw/i386/pc.c | 1 - hw/i386/x86.c | 2 -- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/hw/i386/acpi-microvm.c b/hw/i386/acpi-microvm.c index fec22d85c1..2909a73933 100644 --- a/hw/i386/acpi-microvm.c +++ b/hw/i386/acpi-microvm.c @@ -55,8 +55,8 @@ static void acpi_dsdt_add_virtio(Aml *scope, =20 bus =3D sysbus_get_default(); QTAILQ_FOREACH(kid, &bus->children, sibling) { - DeviceState *dev =3D kid->child; - Object *obj =3D object_dynamic_cast(OBJECT(dev), TYPE_VIRTIO_MMIO); + Object *obj =3D object_dynamic_cast(OBJECT(kid->child), + TYPE_VIRTIO_MMIO); =20 if (obj) { VirtIOMMIOProxy *mmio =3D VIRTIO_MMIO(obj); diff --git a/hw/i386/pc.c b/hw/i386/pc.c index aad7e8ccd1..bb3854d1d0 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1049,7 +1049,6 @@ void pc_memory_init(PCMachineState *pcms, =20 if (machine->device_memory) { uint64_t *val =3D g_malloc(sizeof(*val)); - PCMachineClass *pcmc =3D PC_MACHINE_GET_CLASS(pcms); uint64_t res_mem_end =3D machine->device_memory->base; =20 if (!pcmc->broken_reserved_end) { diff --git a/hw/i386/x86.c b/hw/i386/x86.c index f034df8bf6..b3d054889b 100644 --- a/hw/i386/x86.c +++ b/hw/i386/x86.c @@ -365,8 +365,6 @@ void x86_cpu_pre_plug(HotplugHandler *hotplug_dev, =20 cpu_slot =3D x86_find_cpu_slot(MACHINE(x86ms), cpu->apic_id, &idx); if (!cpu_slot) { - MachineState *ms =3D MACHINE(x86ms); - x86_topo_ids_from_apicid(cpu->apic_id, &topo_info, &topo_ids); error_setg(errp, "Invalid CPU [socket: %u, die: %u, core: %u, thread: %u] with" --=20 2.41.0 From nobody Sat May 18 15:08:28 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=1696592569; cv=none; d=zohomail.com; s=zohoarc; b=X6bizvayB2aM8R52jnivEhw/zsaHFFo1f/A8r7aicTqKwuMNrc9pTgVPNJ2F5sVL7TW8CiJ0hXpqcNHGqFsazPvGd0WXUDXuSOVQAq8kkHuFs9v0E4llu5huTegDREJH58e9A/52p/6OaIpZPfzZ/pvudLbS57T5NAQag7X9Rrk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696592569; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=cNCnM6RelW6FRqtHCtUz0vw/ZVRRzOaHKkAM8cvzZoU=; b=UF/kgX3NSAOuQaKbgm6g70DGQLeLfeSbNlyQad7TRBTwRq5XHDlhvQYjwsJEYioY9iOOdcNu4kigUFnAxo6bC4Vd3Mb55iODICar6N9GKMNwlR9v7L6DtE5A5Ce2Y0Qq5gnK7s0HJkKshvV9VFsuF6m+NmZXyHBm8Z4d5SPd8Zs= 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 169659256917440.01760300427884; Fri, 6 Oct 2023 04:42:49 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoj97-00053g-Bm; Fri, 06 Oct 2023 07:37: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 1qoj8m-0004yk-L8 for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37:09 -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 1qoj8h-00006V-4C for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37:05 -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-653-DE3onJFcPT-fFgtBzGZ5UQ-1; Fri, 06 Oct 2023 07:37:00 -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 AB15A1C06367; Fri, 6 Oct 2023 11:36:59 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8A152492C37; Fri, 6 Oct 2023 11:36:59 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 6350121E690E; Fri, 6 Oct 2023 13:36:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696592221; 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=cNCnM6RelW6FRqtHCtUz0vw/ZVRRzOaHKkAM8cvzZoU=; b=PXW9ivoZjGcbyMc3na6itmtldjxqwSc8mau5Ond9zfKY9YjDSdI5SKzJdWURFl1hsAIa1J oXlAmhlewqdN70x5kfMb07wLvNSuL3aBXSzPr6KCAgEutnq9Qp0ob8/SK07aHfLRsnIBhX TzfQbPbuicOob7xPDZ6ucxPDvOfv9A8= X-MC-Unique: DE3onJFcPT-fFgtBzGZ5UQ-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 05/32] audio/ossaudio: Fix compiler warning with -Wshadow Date: Fri, 6 Oct 2023 13:36:30 +0200 Message-ID: <20231006113657.3803180-6-armbru@redhat.com> In-Reply-To: <20231006113657.3803180-1-armbru@redhat.com> References: <20231006113657.3803180-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.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: 1696592570783100005 From: Thomas Huth The "err" variable is only used twice in this code, in a very local fashion of first assigning it and then checking it in the next line. So there is no need to declare this variable a second time in the innermost block, we can re-use the variable that is declared at the beginning of the function. This fixes the compiler warning that occurs with "-Wshadow". Signed-off-by: Thomas Huth Message-ID: <20231004083900.95856-1-thuth@redhat.com> Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Markus Armbruster --- audio/ossaudio.c | 1 - 1 file changed, 1 deletion(-) diff --git a/audio/ossaudio.c b/audio/ossaudio.c index 3f31852371..c5858284a1 100644 --- a/audio/ossaudio.c +++ b/audio/ossaudio.c @@ -549,7 +549,6 @@ static int oss_init_out(HWVoiceOut *hw, struct audsetti= ngs *as, hw->size_emul); hw->buf_emul =3D NULL; } else { - int err; int trig =3D 0; if (ioctl (fd, SNDCTL_DSP_SETTRIGGER, &trig) < 0) { oss_logerr (errno, "SNDCTL_DSP_SETTRIGGER 0 failed\n"); --=20 2.41.0 From nobody Sat May 18 15:08:28 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=1696592412; cv=none; d=zohomail.com; s=zohoarc; b=gQLlzrI5tVlO+A1F+7c+Y5PhjPdLRccUMDXqZGSRqaTI+aKl7e6N9QEeVIa9OsZdW943KO0tuCMVwyphCFJLH2EEww9ihD33QSP9oBpY1cNCPPq3RDKqoZxje7rdsKaVI4etCUSvn9uJop3fyZVUFBUrhfpnidtj5MeeVPPEwHE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696592412; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=0XhY21QmsLLBiVXGuXCgzmBB9K8MxYLcevoy4YO0rk0=; b=AkXpLxuc69IYDuy4LDen2urv5GdsDoDKAnolU0PxDIc7T0DErR8iteprqzrIntlva0K6EKPSxBxy2wHHJM8+Fc7+Nc3RyD1TsCD1F0vqeMHP7dG06NOMSA7iVzWJbF/mF4g+yDTqpj/hqg/X25ubDnv6MouUjcaaHHSL+y110I8= 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 1696592412160159.72097552457114; Fri, 6 Oct 2023 04:40:12 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoj9A-00054s-Fw; Fri, 06 Oct 2023 07:37: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 1qoj8o-0004zF-6t for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37: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 1qoj8h-00006X-9G for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37: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-342-wtQLLq7eMdWAajxZ6aTfEw-1; Fri, 06 Oct 2023 07:36:59 -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 AC9B7811E8D for ; Fri, 6 Oct 2023 11:36:59 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8C67340C6EC1 for ; Fri, 6 Oct 2023 11:36:59 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 6615821E690F; Fri, 6 Oct 2023 13:36:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696592221; 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=0XhY21QmsLLBiVXGuXCgzmBB9K8MxYLcevoy4YO0rk0=; b=FBknR52YyktRNH3DSebHPnDSx8kfBZ2E6wRaJsog+PSfop5rrWPK6didPoW+KQMzG0qiBd WHZQPY7RdHSsE0VpKC0Le4g5g97bh8OfXYkCQTxbxBdbas/XzW4UoBGQ/vir8KKUSSEuyF f2YQUfLw0SGPThyzGV/yPbiHoAUBR5s= X-MC-Unique: wtQLLq7eMdWAajxZ6aTfEw-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, Thomas Huth , "Michael S . Tsirkin" Subject: [PULL 06/32] hw/net/vhost_net: Silence compiler warning when compiling with -Wshadow Date: Fri, 6 Oct 2023 13:36:31 +0200 Message-ID: <20231006113657.3803180-7-armbru@redhat.com> In-Reply-To: <20231006113657.3803180-1-armbru@redhat.com> References: <20231006113657.3803180-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.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: 1696592413689100002 Content-Type: text/plain; charset="utf-8" From: Thomas Huth Rename the innermost local variables to avoid compiler warnings with "-Wshadow". Signed-off-by: Thomas Huth Message-ID: <20231004084939.96349-1-thuth@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Markus Armbruster --- hw/net/vhost_net.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c index 57427a3997..e8e1661646 100644 --- a/hw/net/vhost_net.c +++ b/hw/net/vhost_net.c @@ -313,8 +313,8 @@ fail: /* Queue might not be ready for start */ continue; } - int r =3D vhost_net_set_backend(&net->dev, &file); - assert(r >=3D 0); + int ret =3D vhost_net_set_backend(&net->dev, &file); + assert(ret >=3D 0); } } if (net->nc->info->poll) { @@ -629,8 +629,8 @@ err_start: if (net->nc->info->type =3D=3D NET_CLIENT_DRIVER_TAP) { file.fd =3D VHOST_FILE_UNBIND; file.index =3D idx; - int r =3D vhost_net_set_backend(&net->dev, &file); - assert(r >=3D 0); + int ret =3D vhost_net_set_backend(&net->dev, &file); + assert(ret >=3D 0); } =20 vhost_dev_stop(&net->dev, vdev, false); --=20 2.41.0 From nobody Sat May 18 15:08:28 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=1696592382; cv=none; d=zohomail.com; s=zohoarc; b=mOpD3c6D75fORJZi8FnkQbgVzM5M7DckF5x9bNY66kHlCQrqxdB88lmwDuGAQHiDg9XRi945gAhRV6fWdJ/r4XCO03Gbc4zdIlEvYNalffZbfM4crBFKmAAswjXWBOCmXM03BSvAvEYnwX1YTHO5yfDNfvZjqHNUFA4GqfdpBuQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696592382; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=8Wjqy/b5KUIIyv5+VdfsykcttIE6ok1OTGxheaSCnq0=; b=G/UbjsrTtPwxzRpBMWSqqWnFjj/XunTExkKMfx4ya3s6SF2OZ9rrHm2UoXnLUSxugbPOV/i6lyVPUclJ3/vOjse7dltG1QPqjdi+Be485PWgvjHafxnF98R6A//r9/qlXAotbY2uUuTSMN+GDixDkIhsRHv80mESPzq+o18z+70= 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 1696592382022737.7476406325721; Fri, 6 Oct 2023 04:39:42 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoj9I-000589-TD; Fri, 06 Oct 2023 07:37: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 1qoj8u-00050r-8b for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37: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 1qoj8o-00008v-6h for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37: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-533-4G_BT-mjMNebQrbrUfpbng-1; Fri, 06 Oct 2023 07:37:00 -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 AACAA3827DE8; Fri, 6 Oct 2023 11:36:59 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8A363140E953; Fri, 6 Oct 2023 11:36:59 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 68EA521E6910; Fri, 6 Oct 2023 13:36:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696592228; 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=8Wjqy/b5KUIIyv5+VdfsykcttIE6ok1OTGxheaSCnq0=; b=DM9DGn564Ryg4objH1K0ue9EyOpYF79m3H75XkqQ/p3zDRGMUiqBzwdTIx28ddR8J9VCIR xTNPZgIN7H/Ka8C69XW4MsmT6BwgiicHLc9TBBueY82Fh5Y5hGR0TuMzDo2rvPBJuPwCJa FgPuM749N9EEHHxPJ9TSWuyGOY0jF8Q= X-MC-Unique: 4G_BT-mjMNebQrbrUfpbng-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 07/32] hw/virtio/virtio-pci: Avoid compiler warning with -Wshadow Date: Fri, 6 Oct 2023 13:36:32 +0200 Message-ID: <20231006113657.3803180-8-armbru@redhat.com> In-Reply-To: <20231006113657.3803180-1-armbru@redhat.com> References: <20231006113657.3803180-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: 1696592383039100005 From: Thomas Huth "len" is used as parameter of the functions virtio_write_config() and virtio_read_config(), and additionally as a local variable, so this causes a compiler warning when compiling with "-Wshadow" and can be confusing for the reader. Rename the local variables to "caplen" to avoid this problem. Signed-off-by: Thomas Huth Message-ID: <20231004095302.99037-1-thuth@redhat.com> Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Markus Armbruster --- hw/virtio/virtio-pci.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index edbc0daa18..abebd0075a 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -780,15 +780,15 @@ static void virtio_write_config(PCIDevice *pci_dev, u= int32_t address, pci_cfg_= data), sizeof cfg->pci_cfg_data)) { uint32_t off; - uint32_t len; + uint32_t caplen; =20 cfg =3D (void *)(proxy->pci_dev.config + proxy->config_cap); off =3D le32_to_cpu(cfg->cap.offset); - len =3D le32_to_cpu(cfg->cap.length); + caplen =3D le32_to_cpu(cfg->cap.length); =20 - if (len =3D=3D 1 || len =3D=3D 2 || len =3D=3D 4) { - assert(len <=3D sizeof cfg->pci_cfg_data); - virtio_address_space_write(proxy, off, cfg->pci_cfg_data, len); + if (caplen =3D=3D 1 || caplen =3D=3D 2 || caplen =3D=3D 4) { + assert(caplen <=3D sizeof cfg->pci_cfg_data); + virtio_address_space_write(proxy, off, cfg->pci_cfg_data, capl= en); } } } @@ -804,15 +804,15 @@ static uint32_t virtio_read_config(PCIDevice *pci_dev, pci_cfg_= data), sizeof cfg->pci_cfg_data)) { uint32_t off; - uint32_t len; + uint32_t caplen; =20 cfg =3D (void *)(proxy->pci_dev.config + proxy->config_cap); off =3D le32_to_cpu(cfg->cap.offset); - len =3D le32_to_cpu(cfg->cap.length); + caplen =3D le32_to_cpu(cfg->cap.length); =20 - if (len =3D=3D 1 || len =3D=3D 2 || len =3D=3D 4) { - assert(len <=3D sizeof cfg->pci_cfg_data); - virtio_address_space_read(proxy, off, cfg->pci_cfg_data, len); + if (caplen =3D=3D 1 || caplen =3D=3D 2 || caplen =3D=3D 4) { + assert(caplen <=3D sizeof cfg->pci_cfg_data); + virtio_address_space_read(proxy, off, cfg->pci_cfg_data, caple= n); } } =20 --=20 2.41.0 From nobody Sat May 18 15:08:28 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=1696592606; cv=none; d=zohomail.com; s=zohoarc; b=SlUPBADO/weT2vmthMn2lygnT4vKEKlvP5nLeEAfOnroN3M5TntpaEl8VvGHaYt3yfR184eqXAnCwQ2RGErGy5XvMHqTY7afm5AKDI1G24hMdCi1ZAlHImR8nlBo/0n03XzeS1eqTaqCGku2GV7sbM4JfV8V2moq6I7tWXOBaZk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696592606; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=7x8VuDt1h0/2cT147JMVxmfA4/SI0gZ5zVSFFGE3UDA=; b=RDoNTjVP50Jg6A7z56jPnVUSa74RlsfeDEODfOPH64YzZZKNdfets07+36l3qkOtVUPIDqz5guExpotWPC+Cv0G6b1UwsfcWsl2qsW5J8M45gMFkTawVVMBOG9ymVfoHGuy5VnnQeZPujKrZmb1IixYdq57r2JZnPrwCa8bS4Dg= 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 1696592606343152.6010357496276; Fri, 6 Oct 2023 04:43:26 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoj9Q-0005CI-QC; Fri, 06 Oct 2023 07:37:48 -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 1qoj8q-0004zo-LL for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37: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 1qoj8j-00007N-3C for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37: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-653-z2CkecMsOomUZftLnhaMqQ-1; Fri, 06 Oct 2023 07:37:00 -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 ABB37101A590; Fri, 6 Oct 2023 11:36:59 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8B4132156711; Fri, 6 Oct 2023 11:36:59 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 6BCD021E6911; Fri, 6 Oct 2023 13:36:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696592223; 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=7x8VuDt1h0/2cT147JMVxmfA4/SI0gZ5zVSFFGE3UDA=; b=IojwjrXMCH+vtEJ2KMQcZMhQRm0BEGWSV8UiVUyynoCVT2l1VSK0NMkeeabGodgW4kiHtS Dfl3LYkIQ/IKGaoFnrkNecZs/6Yr5nPswoiBVrQ7FZ2I90/x/xNf3Wj5w76xiKvzqErgvN 6jM4JT6Mqqzao6r/v4A8om4it5bitt0= X-MC-Unique: z2CkecMsOomUZftLnhaMqQ-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, Thomas Huth , "Michael S . Tsirkin" , Michael Tokarev Subject: [PULL 08/32] hw/virtio/vhost: Silence compiler warnings in vhost code when using -Wshadow Date: Fri, 6 Oct 2023 13:36:33 +0200 Message-ID: <20231006113657.3803180-9-armbru@redhat.com> In-Reply-To: <20231006113657.3803180-1-armbru@redhat.com> References: <20231006113657.3803180-1-armbru@redhat.com> MIME-Version: 1.0 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: 1696592607494100003 Content-Type: text/plain; charset="utf-8" From: Thomas Huth Rename a variable in vhost_dev_sync_region() and remove a superfluous declaration in vhost_commit() to make this code compilable with "-Wshadow". Signed-off-by: Thomas Huth Message-ID: <20231004114809.105672-1-thuth@redhat.com> Reviewed-by: Michael S. Tsirkin Reviewed-By: Michael Tokarev Signed-off-by: Markus Armbruster --- hw/virtio/vhost.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c index e2f6ffb446..9cfac40fde 100644 --- a/hw/virtio/vhost.c +++ b/hw/virtio/vhost.c @@ -66,12 +66,12 @@ static void vhost_dev_sync_region(struct vhost_dev *dev, uint64_t mfirst, uint64_t mlast, uint64_t rfirst, uint64_t rlast) { - vhost_log_chunk_t *log =3D dev->log->log; + vhost_log_chunk_t *dev_log =3D dev->log->log; =20 uint64_t start =3D MAX(mfirst, rfirst); uint64_t end =3D MIN(mlast, rlast); - vhost_log_chunk_t *from =3D log + start / VHOST_LOG_CHUNK; - vhost_log_chunk_t *to =3D log + end / VHOST_LOG_CHUNK + 1; + vhost_log_chunk_t *from =3D dev_log + start / VHOST_LOG_CHUNK; + vhost_log_chunk_t *to =3D dev_log + end / VHOST_LOG_CHUNK + 1; uint64_t addr =3D QEMU_ALIGN_DOWN(start, VHOST_LOG_CHUNK); =20 if (end < start) { @@ -549,7 +549,7 @@ static void vhost_commit(MemoryListener *listener) changed =3D true; } else { /* Same size, lets check the contents */ - for (int i =3D 0; i < n_old_sections; i++) { + for (i =3D 0; i < n_old_sections; i++) { if (!MemoryRegionSection_eq(&old_sections[i], &dev->mem_sections[i])) { changed =3D true; --=20 2.41.0 From nobody Sat May 18 15:08:28 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=1696592415; cv=none; d=zohomail.com; s=zohoarc; b=Z/DcFJA9POrIEVz5ouOpDlM9Te7Ik50aJmpStLGf/eUxCumQ/6GuwAMFmOeP7xw6p9mzOp0tL5VRsArXKWMq0yA6VuHvxbm/p3TUhUcBxUP6tlUkVQGC3IJ/jh1ztyUf6oezu35fearkFauXGaVxVbCcdKuZ0xLv40xPCyVtlfI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696592415; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=VdGblt75VuPuC2ksJAYDKCk+i5yE2oKOwxHJhpzu9rI=; b=LvOi+12hWXbYqfDOpI8NMLL4KY7hVzfMstIno+erxtyNKCKkX12SIBS84n87uuCkgtpT4l+Mp6NpxY9ab+SYXehgOG/OmlqcTd+qBjyw7kwsziRcKH9USfjROJYJT/LU8k9iNDXhrfyofiQWW7c1Xng/Ww31c+i3SKE+JZ/gMw8= 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 1696592415783558.8223238564967; Fri, 6 Oct 2023 04:40:15 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoj9H-00057I-Cq; Fri, 06 Oct 2023 07:37:39 -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 1qoj8t-00050k-LB for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37: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 1qoj8o-00008A-6W for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37: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-533-OwZSAZ50MzaoCAhltZcXsw-1; Fri, 06 Oct 2023 07:37:00 -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 AE8D429A9D38; Fri, 6 Oct 2023 11:36:59 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8B14D40C6EC0; Fri, 6 Oct 2023 11:36:59 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 6EBAB21E6912; Fri, 6 Oct 2023 13:36:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696592225; 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=VdGblt75VuPuC2ksJAYDKCk+i5yE2oKOwxHJhpzu9rI=; b=FJEeG3UVLQd5SwiSNNFZYOuLBi3l4iWXROW3PkaH76wap2AJ0do+1U4k5SbSJlWHkPI5ry TYmIwbt3zPT2YNm2QzMYL/COUuFr21fPm7yxBFOquNZPFHxEaPR4e8VlLxV1hkRQu9vlqA TB+vMabxUhrzTNxRWY9668oGX/4xT7E= X-MC-Unique: OwZSAZ50MzaoCAhltZcXsw-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Michael Tokarev Subject: [PULL 09/32] dump: Silence compiler warning in dump code when compiling with -Wshadow Date: Fri, 6 Oct 2023 13:36:34 +0200 Message-ID: <20231006113657.3803180-10-armbru@redhat.com> In-Reply-To: <20231006113657.3803180-1-armbru@redhat.com> References: <20231006113657.3803180-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: 1696592417728100004 From: Thomas Huth Rename a variable to make this code compilable with -Wshadow. Signed-off-by: Thomas Huth Message-ID: <20231004131338.215081-1-thuth@redhat.com> Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-By: Michael Tokarev Signed-off-by: Markus Armbruster --- dump/dump.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dump/dump.c b/dump/dump.c index d4ef713cd0..d3578ddc62 100644 --- a/dump/dump.c +++ b/dump/dump.c @@ -1872,20 +1872,20 @@ static void dump_init(DumpState *s, int fd, bool ha= s_format, if (vmci) { uint64_t addr, note_head_size, name_size, desc_size; uint32_t size; - uint16_t format; + uint16_t guest_format; =20 note_head_size =3D dump_is_64bit(s) ? sizeof(Elf64_Nhdr) : sizeof(Elf32_Nhdr); =20 - format =3D le16_to_cpu(vmci->vmcoreinfo.guest_format); + guest_format =3D le16_to_cpu(vmci->vmcoreinfo.guest_format); size =3D le32_to_cpu(vmci->vmcoreinfo.size); addr =3D le64_to_cpu(vmci->vmcoreinfo.paddr); if (!vmci->has_vmcoreinfo) { warn_report("guest note is not present"); } else if (size < note_head_size || size > MAX_GUEST_NOTE_SIZE) { warn_report("guest note size is invalid: %" PRIu32, size); - } else if (format !=3D FW_CFG_VMCOREINFO_FORMAT_ELF) { - warn_report("guest note format is unsupported: %" PRIu16, form= at); + } else if (guest_format !=3D FW_CFG_VMCOREINFO_FORMAT_ELF) { + warn_report("guest note format is unsupported: %" PRIu16, gues= t_format); } else { s->guest_note =3D g_malloc(size + 1); /* +1 for adding \0 */ cpu_physical_memory_read(addr, s->guest_note, size); --=20 2.41.0 From nobody Sat May 18 15:08:28 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=1696592282; cv=none; d=zohomail.com; s=zohoarc; b=iF5u2o80HUz2425kkcXhelh5q7mLypmQAw3rjnkbQbE7fFXxgQgD7+EKBcQDbxfglo9gd5cMjFpaZ/4VS0us/HhrdRmRdzXdWPrQ+gd8TEppLYVG0gEp6lAaa0QjVE2aryIsZC5czhL6J57UoR2k2VmG3N++CYL+HbpJ6o3k8/A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696592282; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=WeDsGMFtz4asvODucopxPE5YKxApxjds6GXhzdwffeM=; b=jZi0meDXXJtDx+MrefgXiU0STun3RzPx+uOXVCQv+oD3PYjkW758qO2OpG6WyZpZFljhlV9MPifzwA78Lqo6aM+SV2SHwKLOT9CjlswzLTKJDhCn7qAAaBcVbEzYg/P8t7NO/DoLzQpW8L4AoPhS26g5Bl+ZqhPIe2ajEs8dlxQ= 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 1696592282954377.75965862967803; Fri, 6 Oct 2023 04:38:02 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoj8x-00051J-5v; Fri, 06 Oct 2023 07:37:19 -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 1qoj8o-0004zE-6S for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37: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 1qoj8h-00006U-KA for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37:08 -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-342-vnqYtYC4OMm7mYa7zGU1_Q-1; Fri, 06 Oct 2023 07:37:00 -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 AC3AC1C06370; Fri, 6 Oct 2023 11:36:59 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8AEAB20268CB; Fri, 6 Oct 2023 11:36:59 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 71B2C21E6913; Fri, 6 Oct 2023 13:36:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696592221; 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=WeDsGMFtz4asvODucopxPE5YKxApxjds6GXhzdwffeM=; b=IOIGS9hMfoKyzsS7YG/ImVP6gEUrckauKKwzOH2Q/v2e8pHq5pgrE2DrFpB9YKdE0c6RPA cDMPdHnRAILplv4SCzLrI9pHOEnFZ1nC7VDMJiNP7mmvg1jZF33S0K0DZG40da3lprEBw0 KQ5/Cw2BR/kiNkKLediWhANgXfLGpXE= X-MC-Unique: vnqYtYC4OMm7mYa7zGU1_Q-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , Thomas Huth Subject: [PULL 10/32] hw/audio/soundhw: Clean up global variable shadowing Date: Fri, 6 Oct 2023 13:36:35 +0200 Message-ID: <20231006113657.3803180-11-armbru@redhat.com> In-Reply-To: <20231006113657.3803180-1-armbru@redhat.com> References: <20231006113657.3803180-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, 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: 1696592283570100001 From: Philippe Mathieu-Daud=C3=A9 Fix: hw/audio/soundhw.c:86:33: error: declaration shadows a variable in the gl= obal scope [-Werror,-Wshadow] void select_soundhw(const char *optarg, const char *audiodev) ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/getopt.h:= 77:14: note: previous declaration is here extern char *optarg; /* getopt(3) external variables */ ^ Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20231004120019.93101-2-philmd@linaro.org> Reviewed-by: Richard Henderson Reviewed-by: Thomas Huth Signed-off-by: Markus Armbruster --- include/hw/audio/soundhw.h | 2 +- hw/audio/soundhw.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/hw/audio/soundhw.h b/include/hw/audio/soundhw.h index 270717a06a..474c5ff94e 100644 --- a/include/hw/audio/soundhw.h +++ b/include/hw/audio/soundhw.h @@ -8,6 +8,6 @@ void deprecated_register_soundhw(const char *name, const ch= ar *descr, =20 void soundhw_init(void); void show_valid_soundhw(void); -void select_soundhw(const char *optarg, const char *audiodev); +void select_soundhw(const char *name, const char *audiodev); =20 #endif diff --git a/hw/audio/soundhw.c b/hw/audio/soundhw.c index 94d9463e42..b387b0ef7d 100644 --- a/hw/audio/soundhw.c +++ b/hw/audio/soundhw.c @@ -83,7 +83,7 @@ void show_valid_soundhw(void) static struct soundhw *selected =3D NULL; static const char *audiodev_id; =20 -void select_soundhw(const char *optarg, const char *audiodev) +void select_soundhw(const char *name, const char *audiodev) { struct soundhw *c; =20 @@ -92,7 +92,7 @@ void select_soundhw(const char *optarg, const char *audio= dev) } =20 for (c =3D soundhw; c->name; ++c) { - if (g_str_equal(c->name, optarg)) { + if (g_str_equal(c->name, name)) { selected =3D c; audiodev_id =3D audiodev; break; @@ -100,7 +100,7 @@ void select_soundhw(const char *optarg, const char *aud= iodev) } =20 if (!c->name) { - error_report("Unknown sound card name `%s'", optarg); + error_report("Unknown sound card name `%s'", name); show_valid_soundhw(); exit(1); } --=20 2.41.0 From nobody Sat May 18 15:08:28 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=1696592593; cv=none; d=zohomail.com; s=zohoarc; b=U2exWY64Rk9fA5qW1e9ghcNRS4SrOnYlMaehP00WwdeEdlhf824Hnl96a34FO+Q0rDrZtw/8DSnFsDYLtrTUv7uzwPJeWwaIVzyi1UDEhfY6/ZF5PWp6hvAn7z8QR5VNbnakZy8rZD+slgDsfJuqm0kuQrM0Iy4TP0e8jSQn9a0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696592593; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=8tO50er00dR7aTTYvXvw7IrMFjKlh8I5Sm2ncEgmemg=; b=chwIk5bFwHnVBI63DBYlV26435m3YGiMwaLqK2dZ7qZwGCtaNn7YjCgbYVvjhM58a6S9T3sEszqWcIK0cD71mfYN/b82v1theSp7HsZUKVcPURvx7CCjwwrs3xMwzH5C7cp5CuoiaA/vKHiLHWVw+Qq72J4jQ/EWmiONoR+H3Mg= 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 1696592593215937.2969567974898; Fri, 6 Oct 2023 04:43:13 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoj9Q-0005BS-5h; Fri, 06 Oct 2023 07:37:48 -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 1qoj8z-00052u-A8 for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37:24 -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 1qoj8t-00007l-VA for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37:19 -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-656-sfej_yqrOuu63eVMcmUtNw-1; Fri, 06 Oct 2023 07:37:00 -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 BF4E9811E7E; Fri, 6 Oct 2023 11:36:59 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9F1451054FC0; Fri, 6 Oct 2023 11:36:59 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 74A2921E6914; Fri, 6 Oct 2023 13:36:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696592224; 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=8tO50er00dR7aTTYvXvw7IrMFjKlh8I5Sm2ncEgmemg=; b=EQppMGdu8wgVMBfaosJE3Ev5zebtaeFIhj3b2vQMHBzWkPivtw0S1DRBauDFy/FSW7Vewb T49MBjNvpeJvVe+P4LutoDYP2io/2WRpKSM4YQv2BjjLLR66yr++VW40omBHQU76Q6/Vuv UW+at3gsVZtusazvXH2W35EzqMmPb/o= X-MC-Unique: sfej_yqrOuu63eVMcmUtNw-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , John Snow Subject: [PULL 11/32] hw/ide/ahci: Clean up local variable shadowing Date: Fri, 6 Oct 2023 13:36:36 +0200 Message-ID: <20231006113657.3803180-12-armbru@redhat.com> In-Reply-To: <20231006113657.3803180-1-armbru@redhat.com> References: <20231006113657.3803180-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.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: 1696592595224100015 From: Philippe Mathieu-Daud=C3=A9 Fix: hw/ide/ahci.c:1577:23: error: declaration shadows a local variable [-Werr= or,-Wshadow] IDEState *s =3D &ad->port.ifs[j]; ^ hw/ide/ahci.c:1569:29: note: previous declaration is here void ahci_uninit(AHCIState *s) ^ Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20231004120019.93101-3-philmd@linaro.org> Reviewed-by: Richard Henderson Reviewed-by: John Snow Signed-off-by: Markus Armbruster --- hw/ide/ahci.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c index d0a774bc17..fcc5476e9e 100644 --- a/hw/ide/ahci.c +++ b/hw/ide/ahci.c @@ -1622,9 +1622,7 @@ void ahci_uninit(AHCIState *s) AHCIDevice *ad =3D &s->dev[i]; =20 for (j =3D 0; j < 2; j++) { - IDEState *s =3D &ad->port.ifs[j]; - - ide_exit(s); + ide_exit(&ad->port.ifs[j]); } object_unparent(OBJECT(&ad->port)); } --=20 2.41.0 From nobody Sat May 18 15:08:28 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=1696592536; cv=none; d=zohomail.com; s=zohoarc; b=NRZlqt8KHig46S8yHn+Z+fY5LQLmp6wUhgvJVmIlE6SakEG1RIxHUM07G4HL9v3Otw4dPTpxPj9shB1COyHBbc82RHY0SY2tDR418yzBGZ9FvAd45fQlYaraQTAxbTYCD1xV2uLbscgrVQlB9vqTLu6L/NvOzmzQ/jqemTVoO64= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696592536; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=vTFZ5zkFumeXfVmSRYWZ6swj3UJExKk1gLMUiBKRj5c=; b=KUnWOlRz/hJ0qqfN7evULmrCK0XdJwyP/pkqReYPQgBJXDMaNFzJsOrOC6Sbbyb9hkXctmqCCOGdsWxmwFrWVzqxsMHGSZvq7aJiXP1LOG7ymQ1To+ttZ5SZxPpU3Cl3qnVsMyGWDnNB10YyP/8eIdBHkHCRDRzNrZh5VCZH5QE= 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 1696592536743774.1476048922927; Fri, 6 Oct 2023 04:42:16 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoj9J-00058t-JK; Fri, 06 Oct 2023 07:37: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 1qoj8t-00050m-L4 for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37:16 -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 1qoj8n-00006c-Qe for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37: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-112-7y0ZQEt4PTCO7y5uW97s0Q-1; Fri, 06 Oct 2023 07:37:00 -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 C63C281D781; Fri, 6 Oct 2023 11:36:59 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A54EC1054FC1; Fri, 6 Oct 2023 11:36:59 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 77A6121E6915; Fri, 6 Oct 2023 13:36:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696592221; 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=vTFZ5zkFumeXfVmSRYWZ6swj3UJExKk1gLMUiBKRj5c=; b=CWqHrtiBKg3BH7U3PMaVymAfxhJiWTQSOZAuQkkbuNX4fDLnTkyIVtgM0tka8joOZM0qCf D0YJ1lZdXXN/EJKT9dlEYerZpoXx+CKEXcv5MRH5jpj26wRRck69HzRbgPK14EWcsNm4Jp q2paNixAP6ZS3ppmQBZnqzh/DpECHSU= X-MC-Unique: 7y0ZQEt4PTCO7y5uW97s0Q-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , Thomas Huth Subject: [PULL 12/32] net/net: Clean up global variable shadowing Date: Fri, 6 Oct 2023 13:36:37 +0200 Message-ID: <20231006113657.3803180-13-armbru@redhat.com> In-Reply-To: <20231006113657.3803180-1-armbru@redhat.com> References: <20231006113657.3803180-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.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: 1696592537994100009 From: Philippe Mathieu-Daud=C3=A9 Fix: net/net.c:1680:35: error: declaration shadows a variable in the global sc= ope [-Werror,-Wshadow] bool netdev_is_modern(const char *optarg) ^ net/net.c:1714:38: error: declaration shadows a variable in the global sc= ope [-Werror,-Wshadow] void netdev_parse_modern(const char *optarg) ^ net/net.c:1728:60: error: declaration shadows a variable in the global sc= ope [-Werror,-Wshadow] void net_client_parse(QemuOptsList *opts_list, const char *optarg) ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/getopt.h:= 77:14: note: previous declaration is here extern char *optarg; /* getopt(3) external variables */ ^ Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20231004120019.93101-4-philmd@linaro.org> Reviewed-by: Richard Henderson Reviewed-by: Thomas Huth Signed-off-by: Markus Armbruster --- include/net/net.h | 6 +++--- net/net.c | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/include/net/net.h b/include/net/net.h index 330d285930..2fb1c9181c 100644 --- a/include/net/net.h +++ b/include/net/net.h @@ -247,9 +247,9 @@ extern const char *host_net_devices[]; =20 /* from net.c */ extern NetClientStateList net_clients; -bool netdev_is_modern(const char *optarg); -void netdev_parse_modern(const char *optarg); -void net_client_parse(QemuOptsList *opts_list, const char *str); +bool netdev_is_modern(const char *optstr); +void netdev_parse_modern(const char *optstr); +void net_client_parse(QemuOptsList *opts_list, const char *optstr); void show_netdevs(void); void net_init_clients(void); void net_check_clients(void); diff --git a/net/net.c b/net/net.c index 1c0bfdaa6c..c0c0cbe99e 100644 --- a/net/net.c +++ b/net/net.c @@ -1677,7 +1677,7 @@ void net_init_clients(void) * Modern syntax is to be parsed with netdev_parse_modern(). * Traditional syntax is to be parsed with net_client_parse(). */ -bool netdev_is_modern(const char *optarg) +bool netdev_is_modern(const char *optstr) { QemuOpts *opts; bool is_modern; @@ -1689,13 +1689,13 @@ bool netdev_is_modern(const char *optarg) .desc =3D { { } }, }; =20 - if (optarg[0] =3D=3D '{') { + if (optstr[0] =3D=3D '{') { /* This is JSON, which means it's modern syntax */ return true; } =20 opts =3D qemu_opts_create(&dummy_opts, NULL, false, &error_abort); - qemu_opts_do_parse(opts, optarg, dummy_opts.implied_opt_name, + qemu_opts_do_parse(opts, optstr, dummy_opts.implied_opt_name, &error_abort); type =3D qemu_opt_get(opts, "type"); is_modern =3D !g_strcmp0(type, "stream") || !g_strcmp0(type, "dgram"); @@ -1711,12 +1711,12 @@ bool netdev_is_modern(const char *optarg) * netdev_parse_modern() appends to @nd_queue, whereas net_client_parse() * appends to @qemu_netdev_opts. */ -void netdev_parse_modern(const char *optarg) +void netdev_parse_modern(const char *optstr) { Visitor *v; NetdevQueueEntry *nd; =20 - v =3D qobject_input_visitor_new_str(optarg, "type", &error_fatal); + v =3D qobject_input_visitor_new_str(optstr, "type", &error_fatal); nd =3D g_new(NetdevQueueEntry, 1); visit_type_Netdev(v, NULL, &nd->nd, &error_fatal); visit_free(v); @@ -1725,9 +1725,9 @@ void netdev_parse_modern(const char *optarg) QSIMPLEQ_INSERT_TAIL(&nd_queue, nd, entry); } =20 -void net_client_parse(QemuOptsList *opts_list, const char *optarg) +void net_client_parse(QemuOptsList *opts_list, const char *optstr) { - if (!qemu_opts_parse_noisily(opts_list, optarg, true)) { + if (!qemu_opts_parse_noisily(opts_list, optstr, true)) { exit(1); } } --=20 2.41.0 From nobody Sat May 18 15:08:28 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=1696592663; cv=none; d=zohomail.com; s=zohoarc; b=EhLlklD0NkekfpICT330Yi35ncj7vT871CRUP+lW7T9+IUjhdqCXY+9NduwFtMB5W3EhW5Ww1if1KGNmssFCfn3vJaMMX9N6/dgJk2QA2XOc2YOZq9/MXlCDi8nJhgIe6UM3VDpTKdMTQIxBHFEYWbUqu98FPQtWkJ1j2MtzR5U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696592663; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=CzR+RMIq811dbSevTYmjOhuBh9GlyIdCm7XlyB+I4OM=; b=NOS8QBErQFjL4SnRe/fxtStGGL7gYj4vU0XdYJ6YwEu09JHp/NUZgYdWHOgG8Ss0lTIcP8oU17sG7X2enLjpwZO/O30Bkxk/jcGSJlr0pYWv4KXbgcuGVcTP3zqzR825AyVX9xy7a2jqpfENrgGFulJf0LXnGmb5x3Wjz6qtUz0= 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 1696592663257910.258423917876; Fri, 6 Oct 2023 04:44:23 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoj9K-00059P-7v; Fri, 06 Oct 2023 07:37: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 1qoj8w-00051o-Di for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37: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 1qoj8q-00008C-Df for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37: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-354-aoflsY0cPHOD4_tY0WV8rg-1; Fri, 06 Oct 2023 07:37:00 -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 D708629A9D40; Fri, 6 Oct 2023 11:36:59 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B5DB540C6EA8; Fri, 6 Oct 2023 11:36:59 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 7A90021E6916; Fri, 6 Oct 2023 13:36:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696592225; 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=CzR+RMIq811dbSevTYmjOhuBh9GlyIdCm7XlyB+I4OM=; b=Ox7UCq0cCbu1jCnw/0KNPMy3bPA++oD0eYQHsmVKCBDY24YulQcBmvPhSvOS2qlHeC6YNW qNWwZh+oqCPZchQTtqMqsXFj2VgrWDQY5emlTFNspjO6PB1nIdgbiKw1In83sFY/DSLKFi gyDmSVNaYAUJLE7upc0FhyeABUpMHCY= X-MC-Unique: aoflsY0cPHOD4_tY0WV8rg-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eric Blake , Richard Henderson Subject: [PULL 13/32] os-posix: Clean up global variable shadowing Date: Fri, 6 Oct 2023 13:36:38 +0200 Message-ID: <20231006113657.3803180-14-armbru@redhat.com> In-Reply-To: <20231006113657.3803180-1-armbru@redhat.com> References: <20231006113657.3803180-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: 1696592664442100001 From: Philippe Mathieu-Daud=C3=A9 Fix: os-posix.c:103:31: error: declaration shadows a variable in the global sc= ope [-Werror,-Wshadow] bool os_set_runas(const char *optarg) ^ os-posix.c:176:32: error: declaration shadows a variable in the global sc= ope [-Werror,-Wshadow] void os_set_chroot(const char *optarg) ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/getopt.h:= 77:14: note: previous declaration is here extern char *optarg; /* getopt(3) external variables */ ^ Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20231004120019.93101-5-philmd@linaro.org> Reviewed-by: Eric Blake Reviewed-by: Richard Henderson Signed-off-by: Markus Armbruster --- include/sysemu/os-posix.h | 4 ++-- os-posix.c | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/sysemu/os-posix.h b/include/sysemu/os-posix.h index 6dfdcbb086..dff32ae185 100644 --- a/include/sysemu/os-posix.h +++ b/include/sysemu/os-posix.h @@ -49,8 +49,8 @@ void os_setup_signal_handling(void); int os_set_daemonize(bool d); bool is_daemonized(void); void os_daemonize(void); -bool os_set_runas(const char *optarg); -void os_set_chroot(const char *optarg); +bool os_set_runas(const char *user_id); +void os_set_chroot(const char *path); void os_setup_post(void); int os_mlock(void); =20 diff --git a/os-posix.c b/os-posix.c index f90dfda9b0..52ef6990ff 100644 --- a/os-posix.c +++ b/os-posix.c @@ -94,13 +94,13 @@ static uid_t user_uid =3D (uid_t)-1; /* -1 -1 = >=3D0 */ static gid_t user_gid =3D (gid_t)-1; /* -1 -1 >=3D0 */ =20 /* - * Prepare to change user ID. optarg can be one of 3 forms: + * Prepare to change user ID. user_id can be one of 3 forms: * - a username, in which case user ID will be changed to its uid, * with primary and supplementary groups set up too; * - a numeric uid, in which case only the uid will be set; * - a pair of numeric uid:gid. */ -bool os_set_runas(const char *optarg) +bool os_set_runas(const char *user_id) { unsigned long lv; const char *ep; @@ -108,14 +108,14 @@ bool os_set_runas(const char *optarg) gid_t got_gid; int rc; =20 - user_pwd =3D getpwnam(optarg); + user_pwd =3D getpwnam(user_id); if (user_pwd) { user_uid =3D -1; user_gid =3D -1; return true; } =20 - rc =3D qemu_strtoul(optarg, &ep, 0, &lv); + rc =3D qemu_strtoul(user_id, &ep, 0, &lv); got_uid =3D lv; /* overflow here is ID in C99 */ if (rc || *ep !=3D ':' || got_uid !=3D lv || got_uid =3D=3D (uid_t)-1)= { return false; @@ -173,9 +173,9 @@ static void change_process_uid(void) =20 static const char *chroot_dir; =20 -void os_set_chroot(const char *optarg) +void os_set_chroot(const char *path) { - chroot_dir =3D optarg; + chroot_dir =3D path; } =20 static void change_root(void) --=20 2.41.0 From nobody Sat May 18 15:08:28 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=1696592380; cv=none; d=zohomail.com; s=zohoarc; b=QU9u+ux59p0Fj0PE1/jgLemhDQ42gWT+jV064xOJbx/kNp6aGnOuFqPIap+PZYSvX6nwZh6H/WKQzMmZ20leTP6fRxd/PVCHmQvNOcaAJ//eWphAAc6nEbdsFpDsUXOvXg7rUp5uxmSneJsHdgysRYqZswNtS/RqfIknSDH+OME= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696592380; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=yyqNIrAV89ZLDcW0VZ3dmJJQ7bbyUqitHtkl6WYqbIg=; b=YQk1gSJN3dzgVQ1oek3alJ49hPLiOn1lkGuV14nfTp8H5SrcoaCI4jAoWmeEA54B/RAaY9S4RyKfWrYdUIvqvM9wwarn+tL9TirjCts9SZTmDJ7M6jF4ZcPe/2n+o0KbEi0v6y1oMplybMOnCY2H4yHh/KSHQ1bTy79wuafsLNk= 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 1696592380771512.6286088889184; Fri, 6 Oct 2023 04:39:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoj9I-00057T-47; Fri, 06 Oct 2023 07:37: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 1qoj8u-00050s-8z for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37:16 -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 1qoj8o-00008K-Ll for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37: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-122-V48I8PrHNNiT-_s67WZmYA-1; Fri, 06 Oct 2023 07:37:00 -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 DB36F18175A4; Fri, 6 Oct 2023 11:36:59 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BAABD47AD4A; Fri, 6 Oct 2023 11:36:59 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 7D5C821E691A; Fri, 6 Oct 2023 13:36:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696592225; 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=yyqNIrAV89ZLDcW0VZ3dmJJQ7bbyUqitHtkl6WYqbIg=; b=FkIcl8ZJDH7UoWoKjmTZvxyzHolsHMA8lB6mHOF1Ow73tWVQ+qfd3jsGc5liFWy52Qen6C TQKH77+LN0oHZy42BD0/qnoX6Ftwv0zS2aIceY4qPXZxfAS/auvu+llB8Tq8YY/HFEqokq 4E7Bwc0p019tLf2x2AQ1sXdI6zAKMbk= X-MC-Unique: V48I8PrHNNiT-_s67WZmYA-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 14/32] plugins/loader: Clean up global variable shadowing Date: Fri, 6 Oct 2023 13:36:39 +0200 Message-ID: <20231006113657.3803180-15-armbru@redhat.com> In-Reply-To: <20231006113657.3803180-1-armbru@redhat.com> References: <20231006113657.3803180-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: 1696592381040100001 From: Philippe Mathieu-Daud=C3=A9 Fix: include/qemu/plugin.h:245:54: error: declaration shadows a variable in th= e global scope [-Werror,-Wshadow] static inline void qemu_plugin_opt_parse(const char *optarg, ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/getopt.h:= 77:14: note: previous declaration is here extern char *optarg; /* getopt(3) external variables */ ^ Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20231004120019.93101-6-philmd@linaro.org> Reviewed-by: Richard Henderson Signed-off-by: Markus Armbruster --- include/qemu/plugin.h | 4 ++-- plugins/loader.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/qemu/plugin.h b/include/qemu/plugin.h index bc0781cab8..7fdc3a4849 100644 --- a/include/qemu/plugin.h +++ b/include/qemu/plugin.h @@ -50,7 +50,7 @@ static inline void qemu_plugin_add_opts(void) qemu_add_opts(&qemu_plugin_opts); } =20 -void qemu_plugin_opt_parse(const char *optarg, QemuPluginList *head); +void qemu_plugin_opt_parse(const char *optstr, QemuPluginList *head); int qemu_plugin_load_list(QemuPluginList *head, Error **errp); =20 union qemu_plugin_cb_sig { @@ -242,7 +242,7 @@ void qemu_plugin_user_postfork(bool is_child); static inline void qemu_plugin_add_opts(void) { } =20 -static inline void qemu_plugin_opt_parse(const char *optarg, +static inline void qemu_plugin_opt_parse(const char *optstr, QemuPluginList *head) { error_report("plugin interface not enabled in this build"); diff --git a/plugins/loader.c b/plugins/loader.c index 809f3f9b13..734c11cae0 100644 --- a/plugins/loader.c +++ b/plugins/loader.c @@ -140,12 +140,12 @@ static int plugin_add(void *opaque, const char *name,= const char *value, return 0; } =20 -void qemu_plugin_opt_parse(const char *optarg, QemuPluginList *head) +void qemu_plugin_opt_parse(const char *optstr, QemuPluginList *head) { struct qemu_plugin_parse_arg arg; QemuOpts *opts; =20 - opts =3D qemu_opts_parse_noisily(qemu_find_opts("plugin"), optarg, tru= e); + opts =3D qemu_opts_parse_noisily(qemu_find_opts("plugin"), optstr, tru= e); if (opts =3D=3D NULL) { exit(1); } --=20 2.41.0 From nobody Sat May 18 15:08:28 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=1696592610; cv=none; d=zohomail.com; s=zohoarc; b=N5TzMzr7FaNw+M+M1XKogYOLJO1LnaEDdbF75c+fwLn8K+Ya8OtP+mU0mnFKe75QV1qgKaxtDB3jW8VrJbUWfpTMd9vIjPF6M8t8iYe+q5ahBE2N3ZgOZuTtJsqskGZ/ApA0t9G5UPs+lrcHlopdy0+E6V1gdA9I6PHJvKnLLDI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696592610; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=n4zK6KjuMtQLVDggv3EgqW/6JdP/Ds6q2/MlLzdYfIo=; b=cBxl6hj2fV+fWskPIPAn26nypQxjR92EAES5VMdXzWXxAsrH5zQBm16ZOWQGPdRXEy9h0Lwm2ujgJznPXfF/KkJe9u+FsAQEh4JT1Xqc8kd84R0jQQQUNFhBv1LzXtjmsCmb7tLVoNCbznUxtqezqO8SLsuWGAiT6KKO0+rqkck= 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 1696592610849511.85109234038134; Fri, 6 Oct 2023 04:43:30 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoj9V-0005Eu-C5; Fri, 06 Oct 2023 07:37: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 1qoj96-00054D-Qj for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37:29 -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 1qoj90-0000EB-Iw for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37:25 -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-610-_gTK8oOBPE653dfOeH2B0g-1; Fri, 06 Oct 2023 07:37:01 -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 D797E3827DE8; Fri, 6 Oct 2023 11:37:00 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 952055CC01; Fri, 6 Oct 2023 11:37:00 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 8076E21E691B; Fri, 6 Oct 2023 13:36:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696592239; 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=n4zK6KjuMtQLVDggv3EgqW/6JdP/Ds6q2/MlLzdYfIo=; b=DQRlTDMkRIAhFz8x9k15kOVtRjkQeJM7qX+v+EaurPWii1WqLi/fVurwvomrxGVPFfPmWN bJ7YmMqlezyRK/00AWWhJ/Gz+1z5T44p/GyCNfBire6pmHNNjxluBSEiBZdk7oF/vMs4Bj qUokaaguM8dF0ibvMlSaUtrNaFY8+Pk= X-MC-Unique: _gTK8oOBPE653dfOeH2B0g-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eric Blake , Richard Henderson Subject: [PULL 15/32] qemu-img: Clean up global variable shadowing Date: Fri, 6 Oct 2023 13:36:40 +0200 Message-ID: <20231006113657.3803180-16-armbru@redhat.com> In-Reply-To: <20231006113657.3803180-1-armbru@redhat.com> References: <20231006113657.3803180-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, 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: 1696592611617100001 From: Philippe Mathieu-Daud=C3=A9 Fix: qemu-img.c:247:46: error: declaration shadows a variable in the global sc= ope [-Werror,-Wshadow] static bool is_valid_option_list(const char *optarg) ^ qemu-img.c:265:53: error: declaration shadows a variable in the global sc= ope [-Werror,-Wshadow] static int accumulate_options(char **options, char *optarg) ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/getopt.h:= 77:14: note: previous declaration is here extern char *optarg; /* getopt(3) external variables */ ^ Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20231004120019.93101-7-philmd@linaro.org> Reviewed-by: Eric Blake Reviewed-by: Richard Henderson Signed-off-by: Markus Armbruster --- qemu-img.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index a48edb7101..6068ab0d27 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -235,25 +235,25 @@ void help(void) } =20 /* - * Is @optarg safe for accumulate_options()? + * Is @list safe for accumulate_options()? * It is when multiple of them can be joined together separated by ','. - * To make that work, @optarg must not start with ',' (or else a + * To make that work, @list must not start with ',' (or else a * separating ',' preceding it gets escaped), and it must not end with * an odd number of ',' (or else a separating ',' following it gets * escaped), or be empty (or else a separating ',' preceding it can * escape a separating ',' following it). *=20 */ -static bool is_valid_option_list(const char *optarg) +static bool is_valid_option_list(const char *list) { - size_t len =3D strlen(optarg); + size_t len =3D strlen(list); size_t i; =20 - if (!optarg[0] || optarg[0] =3D=3D ',') { + if (!list[0] || list[0] =3D=3D ',') { return false; } =20 - for (i =3D len; i > 0 && optarg[i - 1] =3D=3D ','; i--) { + for (i =3D len; i > 0 && list[i - 1] =3D=3D ','; i--) { } if ((len - i) % 2) { return false; @@ -262,19 +262,19 @@ static bool is_valid_option_list(const char *optarg) return true; } =20 -static int accumulate_options(char **options, char *optarg) +static int accumulate_options(char **options, char *list) { char *new_options; =20 - if (!is_valid_option_list(optarg)) { - error_report("Invalid option list: %s", optarg); + if (!is_valid_option_list(list)) { + error_report("Invalid option list: %s", list); return -1; } =20 if (!*options) { - *options =3D g_strdup(optarg); + *options =3D g_strdup(list); } else { - new_options =3D g_strdup_printf("%s,%s", *options, optarg); + new_options =3D g_strdup_printf("%s,%s", *options, list); g_free(*options); *options =3D new_options; } --=20 2.41.0 From nobody Sat May 18 15:08:28 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=1696592561; cv=none; d=zohomail.com; s=zohoarc; b=S58iKBmozVv0OKbWl0tVCfd6hv1hvtb2NitdshcJegqtfdAzqeiDGJae0cFmAOtW6nPwBwKOO4oS0joIIUBWh0SkHO4pVhpXJkAFtPXHmjdD+aE1NeVth2gKJyLjsR8XCTlWBfR2mz+Yngl4USVYxvsjxETwCi54JM6o+rSolfs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696592561; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=UcknsHua8YgZyyV7nIDQ/TchOkuc6nnQyZPLvod9uD4=; b=DB8+y39VDi0tRb/xvjH67thnJ2E2Vl7dx+oUWKDla1GDlMOjEbS/HNy96iJKMtduPGws2fmdlcYhKsszMynR9kF3YR8ukiqk8OgEdJX2wlIfDOLUuhK1rkvLZj/0HfOjOUDLry23U167cTShW/DJhhFennx0vFlrR3q0QdNpcek= 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 1696592561023465.74987141043266; Fri, 6 Oct 2023 04:42:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoj9H-00057K-HI; Fri, 06 Oct 2023 07:37:39 -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 1qoj8w-00051m-CR for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37: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 1qoj8t-0000Ao-7L for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37: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-388-0yn3IVeBMgy__mbPnEaeVw-1; Fri, 06 Oct 2023 07:37:01 -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 D75E818175A1; Fri, 6 Oct 2023 11:37:00 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 957A91054FC0; Fri, 6 Oct 2023 11:37:00 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 835C321E691C; Fri, 6 Oct 2023 13:36:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696592234; 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=UcknsHua8YgZyyV7nIDQ/TchOkuc6nnQyZPLvod9uD4=; b=JB5ZLYv5Alzm204ha/9nbCWoM9QKxAQtzOQVMPs6J6cpmThcaCYq4CClM4qxRbk6ywzTJ+ HLjYsrPemA+Q5gqcJzjuIPexBATziJRip9qm+dCr1ECn+acwr++3cLytqbOLSHspDTsD23 xhQsPu4uOyplCZaspJFF9cPVI9RUuCo= X-MC-Unique: 0yn3IVeBMgy__mbPnEaeVw-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eric Blake , Richard Henderson Subject: [PULL 16/32] qemu-io: Clean up global variable shadowing Date: Fri, 6 Oct 2023 13:36:41 +0200 Message-ID: <20231006113657.3803180-17-armbru@redhat.com> In-Reply-To: <20231006113657.3803180-1-armbru@redhat.com> References: <20231006113657.3803180-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.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: 1696592562639100003 From: Philippe Mathieu-Daud=C3=A9 Fix: qemu-io.c:478:36: error: declaration shadows a variable in the global sco= pe [-Werror,-Wshadow] static void add_user_command(char *optarg) ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/getopt.h:= 77:14: note: previous declaration is here extern char *optarg; /* getopt(3) external variables */ ^ Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20231004120019.93101-8-philmd@linaro.org> Reviewed-by: Eric Blake Reviewed-by: Richard Henderson Signed-off-by: Markus Armbruster --- qemu-io.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qemu-io.c b/qemu-io.c index 2bd7bfb650..050c70835f 100644 --- a/qemu-io.c +++ b/qemu-io.c @@ -475,10 +475,10 @@ static int command_loop(void) return last_error; } =20 -static void add_user_command(char *optarg) +static void add_user_command(char *user_cmd) { cmdline =3D g_renew(char *, cmdline, ++ncmdline); - cmdline[ncmdline-1] =3D optarg; + cmdline[ncmdline - 1] =3D user_cmd; } =20 static void reenable_tty_echo(void) --=20 2.41.0 From nobody Sat May 18 15:08:28 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=1696592505; cv=none; d=zohomail.com; s=zohoarc; b=M0P3w6GkdQBnGYnnSrxxp5sCYuHxHlUNQa8YCLROsQchtWU36rhUnizUEcfzScF55e2tsWefVC+AWGO/sSchzMet8+tWHzckBBUTJ1Ea6uPT+qHGgVYJ4skWwaRrIhXXpi2R9nJvNvCObrCp4a0jT11fi6Gqnp8/LRVhnOw7xqo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696592505; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=kQ+pT3ow6c+WuoVGzJFiDX22KI3j54JHlCbDNYJLjwE=; b=LXks5yvJoQ/OpuBMAT/T3ZEzNw6I24eJX9PDuQLOdly6itvg2GMEDIEtYP8PJMshNN6lKsVHmZtqgruOcrFy08RHlHNQJXVoqgV8otf7Uw+Fy46XUWg0X2yAoeEmQWJwEppxQKV7c2Faaa0gs8qaikDlI6G2P4T9n+fMJCgN3Fg= 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 1696592505483927.1742987587049; Fri, 6 Oct 2023 04:41:45 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoj9L-0005A9-Ee; Fri, 06 Oct 2023 07:37:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qoj96-00054E-Vi for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37:29 -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 1qoj92-0000EK-Of for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37:26 -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-418-UuB_B-BbNG25SXr0P506Yg-1; Fri, 06 Oct 2023 07:37:01 -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 D3C35101A58B; Fri, 6 Oct 2023 11:37:00 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 956A72156711; Fri, 6 Oct 2023 11:37:00 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 8644C21E6880; Fri, 6 Oct 2023 13:36:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696592239; 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=kQ+pT3ow6c+WuoVGzJFiDX22KI3j54JHlCbDNYJLjwE=; b=OwaMSJV1Iwybc4yhdPGG8V0+qPCj1pOZps1VbmbcFvr5prR4xbTVP4X1LVXzC84sgi9uTp 0QENm4AZkPo3AM6529Cx8brpCmCYxDRf28NF/0D4OlWhMj/0bGkBClFS/pLMIqkfVL6leK Eg1jB+ZcQdNjwfRboIkOM6VcDQhkrt0= X-MC-Unique: UuB_B-BbNG25SXr0P506Yg-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 17/32] qom/object_interfaces: Clean up global variable shadowing Date: Fri, 6 Oct 2023 13:36:42 +0200 Message-ID: <20231006113657.3803180-18-armbru@redhat.com> In-Reply-To: <20231006113657.3803180-1-armbru@redhat.com> References: <20231006113657.3803180-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.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: 1696592507442100006 From: Philippe Mathieu-Daud=C3=A9 Fix: qom/object_interfaces.c:262:53: error: declaration shadows a variable in = the global scope [-Werror,-Wshadow] ObjectOptions *user_creatable_parse_str(const char *optarg, Error **errp) ^ qom/object_interfaces.c:298:46: error: declaration shadows a variable in = the global scope [-Werror,-Wshadow] bool user_creatable_add_from_str(const char *optarg, Error **errp) ^ qom/object_interfaces.c:313:49: error: declaration shadows a variable in = the global scope [-Werror,-Wshadow] void user_creatable_process_cmdline(const char *optarg) ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/getopt.h:= 77:14: note: previous declaration is here extern char *optarg; /* getopt(3) external variables */ ^ Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20231004120019.93101-9-philmd@linaro.org> Reviewed-by: Richard Henderson Signed-off-by: Markus Armbruster --- include/qom/object_interfaces.h | 16 ++++++++-------- qom/object_interfaces.c | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/include/qom/object_interfaces.h b/include/qom/object_interface= s.h index 81541e2080..02b11a7ef0 100644 --- a/include/qom/object_interfaces.h +++ b/include/qom/object_interfaces.h @@ -99,7 +99,7 @@ void user_creatable_add_qapi(ObjectOptions *options, Erro= r **errp); =20 /** * user_creatable_parse_str: - * @optarg: the object definition string as passed on the command line + * @str: the object definition string as passed on the command line * @errp: if an error occurs, a pointer to an area to store the error * * Parses the option for the user creatable object with a keyval parser and @@ -110,14 +110,14 @@ void user_creatable_add_qapi(ObjectOptions *options, = Error **errp); * Returns: ObjectOptions on success, NULL when an error occurred (*errp i= s set * then) or help was printed (*errp is not set). */ -ObjectOptions *user_creatable_parse_str(const char *optarg, Error **errp); +ObjectOptions *user_creatable_parse_str(const char *str, Error **errp); =20 /** * user_creatable_add_from_str: - * @optarg: the object definition string as passed on the command line + * @str: the object definition string as passed on the command line * @errp: if an error occurs, a pointer to an area to store the error * - * Create an instance of the user creatable object by parsing optarg + * Create an instance of the user creatable object by parsing @str * with a keyval parser and implicit key 'qom-type', converting the * result to ObjectOptions and calling into qmp_object_add(). * @@ -126,13 +126,13 @@ ObjectOptions *user_creatable_parse_str(const char *o= ptarg, Error **errp); * Returns: true when an object was successfully created, false when an er= ror * occurred (*errp is set then) or help was printed (*errp is not set). */ -bool user_creatable_add_from_str(const char *optarg, Error **errp); +bool user_creatable_add_from_str(const char *str, Error **errp); =20 /** * user_creatable_process_cmdline: - * @optarg: the object definition string as passed on the command line + * @cmdline: the object definition string as passed on the command line * - * Create an instance of the user creatable object by parsing optarg + * Create an instance of the user creatable object by parsing @cmdline * with a keyval parser and implicit key 'qom-type', converting the * result to ObjectOptions and calling into qmp_object_add(). * @@ -141,7 +141,7 @@ bool user_creatable_add_from_str(const char *optarg, Er= ror **errp); * This function is only meant to be called during command line parsing. * It exits the process on failure or after printing help. */ -void user_creatable_process_cmdline(const char *optarg); +void user_creatable_process_cmdline(const char *cmdline); =20 /** * user_creatable_print_help: diff --git a/qom/object_interfaces.c b/qom/object_interfaces.c index 7d31589b04..e0833c8bfe 100644 --- a/qom/object_interfaces.c +++ b/qom/object_interfaces.c @@ -259,7 +259,7 @@ static void user_creatable_print_help_from_qdict(QDict = *args) } } =20 -ObjectOptions *user_creatable_parse_str(const char *optarg, Error **errp) +ObjectOptions *user_creatable_parse_str(const char *str, Error **errp) { ERRP_GUARD(); QObject *obj; @@ -267,14 +267,14 @@ ObjectOptions *user_creatable_parse_str(const char *o= ptarg, Error **errp) Visitor *v; ObjectOptions *options; =20 - if (optarg[0] =3D=3D '{') { - obj =3D qobject_from_json(optarg, errp); + if (str[0] =3D=3D '{') { + obj =3D qobject_from_json(str, errp); if (!obj) { return NULL; } v =3D qobject_input_visitor_new(obj); } else { - QDict *args =3D keyval_parse(optarg, "qom-type", &help, errp); + QDict *args =3D keyval_parse(str, "qom-type", &help, errp); if (*errp) { return NULL; } @@ -295,12 +295,12 @@ ObjectOptions *user_creatable_parse_str(const char *o= ptarg, Error **errp) return options; } =20 -bool user_creatable_add_from_str(const char *optarg, Error **errp) +bool user_creatable_add_from_str(const char *str, Error **errp) { ERRP_GUARD(); ObjectOptions *options; =20 - options =3D user_creatable_parse_str(optarg, errp); + options =3D user_creatable_parse_str(str, errp); if (!options) { return false; } @@ -310,9 +310,9 @@ bool user_creatable_add_from_str(const char *optarg, Er= ror **errp) return !*errp; } =20 -void user_creatable_process_cmdline(const char *optarg) +void user_creatable_process_cmdline(const char *cmdline) { - if (!user_creatable_add_from_str(optarg, &error_fatal)) { + if (!user_creatable_add_from_str(cmdline, &error_fatal)) { /* Help was printed */ exit(EXIT_SUCCESS); } --=20 2.41.0 From nobody Sat May 18 15:08:28 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=1696592347; cv=none; d=zohomail.com; s=zohoarc; b=eu+lKV+2O8CpuXhTG45DhgYtIyDTJVhWd/phDwGgTHguMSglrkurdjanNRPB53fmPBH4xiGOt59zF7DcSIUp6DKdLexBArU2moSSi6fz6aKbwcqPoNMC2MbnzukPNT6FTBjq7AWMrICNwM4YnEDCK1j04vMdVz9LWaWy85EIl4g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696592347; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=E0/SmeVkKQwC85Yi9z735skKKvyYk8aaSrlBFMMKON8=; b=H4PRgXppXmjEuS1O9cQMFitWemuYRcrA/Ya4HwgPq+Pem7cytlbsfP2v9VJ3ZXw50WnNfjBp890vKWWvq7gJL5P9uGU5s8a60p4CMWdVOdtd8fBIKuFas54jdKzKXCmetbfRdMHV9K62/RNwx7CKDUchm0MEc23dIGhR/X2b8mk= 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 1696592347949796.2170108773137; Fri, 6 Oct 2023 04:39:07 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoj9E-000557-4D; Fri, 06 Oct 2023 07:37: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 1qoj8t-00050l-Lr for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37: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 1qoj8n-00007B-UC for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37: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-57-GUgSinHLNO6mKmG-zgCWcQ-1; Fri, 06 Oct 2023 07:37:01 -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 B8A191C06367; Fri, 6 Oct 2023 11:37:00 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 95DC440C6EA8; Fri, 6 Oct 2023 11:37:00 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 8934E21E6882; Fri, 6 Oct 2023 13:36:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696592222; 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=E0/SmeVkKQwC85Yi9z735skKKvyYk8aaSrlBFMMKON8=; b=cGcp62DKW/hNGMXMM4WlkPkwL5d4ZErAW0KWOH1oFMnOXGBJvA2QRY/A7CppF9VR2BZeuh /Spttx/p8kPRNHyApM1ztcEghKHCTsVlEU6+uPcpeKN29CjIyPco6y0BIpuQ/73hVIMgyQ D7g5CXOhHQfD/IKsLEEkYFe0OqDselI= X-MC-Unique: GUgSinHLNO6mKmG-zgCWcQ-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson Subject: [PULL 18/32] semihosting: Clean up global variable shadowing Date: Fri, 6 Oct 2023 13:36:43 +0200 Message-ID: <20231006113657.3803180-19-armbru@redhat.com> In-Reply-To: <20231006113657.3803180-1-armbru@redhat.com> References: <20231006113657.3803180-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: 1696592348297100001 From: Philippe Mathieu-Daud=C3=A9 Fix: semihosting/config.c:134:49: error: declaration shadows a variable in the= global scope [-Werror,-Wshadow] int qemu_semihosting_config_options(const char *optarg) ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/getopt.h:= 77:14: note: previous declaration is here extern char *optarg; /* getopt(3) external variables */ ^ Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20231004120019.93101-10-philmd@linaro.org> Reviewed-by: Alex Benn=C3=A9e Reviewed-by: Richard Henderson Signed-off-by: Markus Armbruster --- include/semihosting/semihost.h | 2 +- semihosting/config.c | 8 ++++---- stubs/semihost.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/semihosting/semihost.h b/include/semihosting/semihost.h index efd2efa25a..97d2a2ba99 100644 --- a/include/semihosting/semihost.h +++ b/include/semihosting/semihost.h @@ -66,7 +66,7 @@ const char *semihosting_get_cmdline(void); void semihosting_arg_fallback(const char *file, const char *cmd); /* for vl.c hooks */ void qemu_semihosting_enable(void); -int qemu_semihosting_config_options(const char *opt); +int qemu_semihosting_config_options(const char *optstr); void qemu_semihosting_chardev_init(void); void qemu_semihosting_console_init(Chardev *); #endif /* CONFIG_USER_ONLY */ diff --git a/semihosting/config.c b/semihosting/config.c index 8ca569735d..e826457733 100644 --- a/semihosting/config.c +++ b/semihosting/config.c @@ -131,10 +131,10 @@ void qemu_semihosting_enable(void) semihosting.target =3D SEMIHOSTING_TARGET_AUTO; } =20 -int qemu_semihosting_config_options(const char *optarg) +int qemu_semihosting_config_options(const char *optstr) { QemuOptsList *opt_list =3D qemu_find_opts("semihosting-config"); - QemuOpts *opts =3D qemu_opts_parse_noisily(opt_list, optarg, false); + QemuOpts *opts =3D qemu_opts_parse_noisily(opt_list, optstr, false); =20 semihosting.enabled =3D true; =20 @@ -155,7 +155,7 @@ int qemu_semihosting_config_options(const char *optarg) semihosting.target =3D SEMIHOSTING_TARGET_AUTO; } else { error_report("unsupported semihosting-config %s", - optarg); + optstr); return 1; } } else { @@ -165,7 +165,7 @@ int qemu_semihosting_config_options(const char *optarg) qemu_opt_foreach(opts, add_semihosting_arg, &semihosting, NULL); } else { - error_report("unsupported semihosting-config %s", optarg); + error_report("unsupported semihosting-config %s", optstr); return 1; } =20 diff --git a/stubs/semihost.c b/stubs/semihost.c index aad7a70353..b3c61935b3 100644 --- a/stubs/semihost.c +++ b/stubs/semihost.c @@ -36,7 +36,7 @@ void qemu_semihosting_enable(void) { } =20 -int qemu_semihosting_config_options(const char *optarg) +int qemu_semihosting_config_options(const char *optstr) { return 1; } --=20 2.41.0 From nobody Sat May 18 15:08:28 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=1696592349; cv=none; d=zohomail.com; s=zohoarc; b=F99o42TwItzabkAyox90PO5i/HPGCPoMpmYxvUKMgM2OsQT4Nl9//CqYDdzSywPrhu6CRfdhgcbA1jZMCDUmM+mgF66WeSFhaauHIwuIxyc0yLmTk0v6zmL3t04BXd4vAGKjBmc2EvGA0t8C5G6jVrTPj14M2N+CB/9LT3f+e2M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696592349; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=TcMr9UNXIYVFqDWLs8PuAu50D7wm7GFqqHd0XuLYOis=; b=l1sOyG1KyAh8TmbTceriynSX7jar+oRicwarVxmJ/26yjRav6wwBY7PbApbgMkQLZPbQa8Z2wfri980Ig7BLI2UTZMvaSPeZ8LNdTDpVtCtpaigtFQ855dI8gSH6ViYGENfoovgsV1tw9/khbPTELe13CJthCF84hIEbl91yIsY= 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 169659234912212.21321443558088; Fri, 6 Oct 2023 04:39:09 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoj9S-0005CS-Jc; Fri, 06 Oct 2023 07:37:50 -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 1qoj8w-00051t-Vc for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37: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 1qoj8t-00007c-8O for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37:18 -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-388-nRiQqCyxN2iP440Z7DHFJQ-1; Fri, 06 Oct 2023 07:37:01 -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 D764A811E8D; Fri, 6 Oct 2023 11:37:00 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9B88F1054FC1; Fri, 6 Oct 2023 11:37:00 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 8C0DD21E6883; Fri, 6 Oct 2023 13:36:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696592223; 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=TcMr9UNXIYVFqDWLs8PuAu50D7wm7GFqqHd0XuLYOis=; b=fgRPhZdjR/8wkI0PoZ2k+Jbx3DrJvLfvJUbWGTxWwfXl1qXNXJ1Z62ugw5jSG6GJSlapCL ij8S09V09lpLqG6D/fkXPd0rggPxaUCxNBxk72NU2qCn9T5IH0cm7jhNxZXL+SF+zt+Bcc hhBHq7uaXOQmaixMzbSibH+yWC+91k4= X-MC-Unique: nRiQqCyxN2iP440Z7DHFJQ-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , Akihiko Odaki Subject: [PULL 19/32] ui/cocoa: Clean up global variable shadowing Date: Fri, 6 Oct 2023 13:36:44 +0200 Message-ID: <20231006113657.3803180-20-armbru@redhat.com> In-Reply-To: <20231006113657.3803180-1-armbru@redhat.com> References: <20231006113657.3803180-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.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: 1696592350350100010 From: Philippe Mathieu-Daud=C3=A9 Fix: ui/cocoa.m:346:20: error: declaration shadows a variable in the global sc= ope [-Werror,-Wshadow] QemuCocoaView *cocoaView =3D userInfo; ^ ui/cocoa.m:342:16: note: previous declaration is here QemuCocoaView *cocoaView; ^ Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20231004120019.93101-11-philmd@linaro.org> Reviewed-by: Richard Henderson Reviewed-by: Akihiko Odaki Signed-off-by: Markus Armbruster --- ui/cocoa.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/cocoa.m b/ui/cocoa.m index 145f42d190..d95276013c 100644 --- a/ui/cocoa.m +++ b/ui/cocoa.m @@ -343,9 +343,9 @@ - (void) raiseAllKeys; =20 static CGEventRef handleTapEvent(CGEventTapProxy proxy, CGEventType type, = CGEventRef cgEvent, void *userInfo) { - QemuCocoaView *cocoaView =3D userInfo; + QemuCocoaView *view =3D userInfo; NSEvent *event =3D [NSEvent eventWithCGEvent:cgEvent]; - if ([cocoaView isMouseGrabbed] && [cocoaView handleEvent:event]) { + if ([view isMouseGrabbed] && [view handleEvent:event]) { COCOA_DEBUG("Global events tap: qemu handled the event, capturing!= \n"); return NULL; } --=20 2.41.0 From nobody Sat May 18 15:08:28 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=1696592396; cv=none; d=zohomail.com; s=zohoarc; b=Kf+IHVVPwX5WSKZi+buq8O6ryWDbDpup4W9vXg1kO38Snfw66Iaqeg3nt4GNHlAXIww9Yqw/j5bmay+WL25ZXnirwgLKlrHoHLYg3agHa1dlq/fq99mFTQzmsCD3ZROvDjBvJoV72w/8U84S1I5Hv5qFjP8nZEMw4lFS2L/EM1w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696592396; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=PmF1lPTY/N4yZXnoI95jbT0XyzCg+nV6j51RKZahf70=; b=aJzV4v46E3KREFtHDJpJxZ6PpcjqG80fkkkM5xngTiaUo/Emw/zZvJcXNDjHgjGCRUvpWcmD1yTLfVniZvKOmsMg70EdIaimqzqLQw3cnpQ6rVPvgJVH1BbtLS0tUqnxemuGKziGISDAustLfHYR1B53upECUneaEs06ZLQoPXE= 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 1696592396646106.39132329346762; Fri, 6 Oct 2023 04:39:56 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoj9I-00057o-J7; Fri, 06 Oct 2023 07:37: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 1qoj8z-00052v-AG for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37:24 -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 1qoj8t-0000Ar-8d for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37:19 -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-610-FRB752AhO7i51ut9_CXhsQ-1; Fri, 06 Oct 2023 07:37:01 -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 B8385811E8E; Fri, 6 Oct 2023 11:37:00 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 96C8640C6EC0; Fri, 6 Oct 2023 11:37:00 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 8EF3421E6884; Fri, 6 Oct 2023 13:36:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696592234; 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=PmF1lPTY/N4yZXnoI95jbT0XyzCg+nV6j51RKZahf70=; b=VuQBsMfbNTj2RPTNVW0d3rgbEb3z3eoyvrKZo86fEelaki7cwT2ieOxHhDIWVy4y/m4Cwa r/zSHdjz1GPLJIeKL/siHJszDYkecoptx2QgpPpmiiXht7tVtulQAuM6zDsnmvhq/DDQJj lCU2EROBQGn7cSe1TxILrgVfpp+UahQ= X-MC-Unique: FRB752AhO7i51ut9_CXhsQ-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eric Blake , Richard Henderson Subject: [PULL 20/32] util/cutils: Clean up global variable shadowing in get_relocated_path() Date: Fri, 6 Oct 2023 13:36:45 +0200 Message-ID: <20231006113657.3803180-21-armbru@redhat.com> In-Reply-To: <20231006113657.3803180-1-armbru@redhat.com> References: <20231006113657.3803180-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: 1696592397221100001 From: Philippe Mathieu-Daud=C3=A9 Fix: util/cutils.c:1147:17: error: declaration shadows a variable in the globa= l scope [-Werror,-Wshadow] const char *exec_dir =3D qemu_get_exec_dir(); ^ util/cutils.c:1035:20: note: previous declaration is here static const char *exec_dir; ^ Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20231004120019.93101-12-philmd@linaro.org> Reviewed-by: Eric Blake Reviewed-by: Richard Henderson Signed-off-by: Markus Armbruster --- util/cutils.c | 1 - 1 file changed, 1 deletion(-) diff --git a/util/cutils.c b/util/cutils.c index 25373198ad..b44718a6a2 100644 --- a/util/cutils.c +++ b/util/cutils.c @@ -1144,7 +1144,6 @@ char *get_relocated_path(const char *dir) { size_t prefix_len =3D strlen(CONFIG_PREFIX); const char *bindir =3D CONFIG_BINDIR; - const char *exec_dir =3D qemu_get_exec_dir(); GString *result; int len_dir, len_bindir; =20 --=20 2.41.0 From nobody Sat May 18 15:08:28 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=1696592505; cv=none; d=zohomail.com; s=zohoarc; b=Fv7XVidVrobQe5VOcDP4QCrDj8s29uMjz72FeXnfT5I9rLt36ZutHy+P16R498nouH7p6MXS6mm8KXtIMUmfGZI8MTdmSIgAebgjoEeW8RtQ29gRz2xsyg6d2TnxueVqjwJ0uprFF8Jyybg4eHOo/mxW/+WpFprBENjQZg/SUBw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696592505; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=+n7FavU8lRQasqyJ6zeG5ii/6CvqBflzCFUIfyjdja4=; b=FdNV0U0pCp2tVWfC0IZNQ+iWulvdfdWT1AjBUMY64hpBGGqMpjgL/CFixTrfC+ystoPBBmPveqWiJ/oUEE+kCm2mDZa24ZXt6JQTH50JoKx8BM6zh8uLrDtmjLqpnILRL/okEmuWMU9Uv3+DYGTbA3/+Hf5ukL5mdYxAfIeHuH0= 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 1696592505475702.8166096236067; Fri, 6 Oct 2023 04:41:45 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoj9H-00056v-6h; Fri, 06 Oct 2023 07:37:39 -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 1qoj8q-0004zn-L4 for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37: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 1qoj8m-00007u-9j for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37: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-65-X-hnvj4XOtCa_kcywqJiXA-1; Fri, 06 Oct 2023 07:37:01 -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 BA32029A9D42; Fri, 6 Oct 2023 11:37:00 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 97D2240D1EA; Fri, 6 Oct 2023 11:37:00 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 91BEB21E6885; Fri, 6 Oct 2023 13:36:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696592224; 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=+n7FavU8lRQasqyJ6zeG5ii/6CvqBflzCFUIfyjdja4=; b=Qef8mxynfu2Lf9YbP4OVntVCuEAsPq1RocHnHMMKCM3g7KGU/+BOPjwKHOs5ROyTdw3RIi blTSDU+LNJ34Hs+JEpDLsgD5EG3jwfRveLrwpkAWyJw8Htmmyysr2OYC+eP5yGkTm4zTRJ jBlqpEBoq4NN2yCO0C8c0euN86btBC0= X-MC-Unique: X-hnvj4XOtCa_kcywqJiXA-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 21/32] util/guest-random: Clean up global variable shadowing Date: Fri, 6 Oct 2023 13:36:46 +0200 Message-ID: <20231006113657.3803180-22-armbru@redhat.com> In-Reply-To: <20231006113657.3803180-1-armbru@redhat.com> References: <20231006113657.3803180-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.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: 1696592507424100005 From: Philippe Mathieu-Daud=C3=A9 Fix: util/guest-random.c:90:45: error: declaration shadows a variable in the g= lobal scope [-Werror,-Wshadow] int qemu_guest_random_seed_main(const char *optarg, Error **errp) ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/getopt.h:= 77:14: note: previous declaration is here extern char *optarg; /* getopt(3) external variables */ ^ Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20231004120019.93101-13-philmd@linaro.org> Reviewed-by: Richard Henderson Signed-off-by: Markus Armbruster --- include/qemu/guest-random.h | 8 ++++---- util/guest-random.c | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/qemu/guest-random.h b/include/qemu/guest-random.h index 09ff9c2236..5060d49d60 100644 --- a/include/qemu/guest-random.h +++ b/include/qemu/guest-random.h @@ -13,16 +13,16 @@ #define QEMU_GUEST_RANDOM_H =20 /** - * qemu_guest_random_seed_main(const char *optarg, Error **errp) - * @optarg: a non-NULL pointer to a C string + * qemu_guest_random_seed_main(const char *seedstr, Error **errp) + * @seedstr: a non-NULL pointer to a C string * @errp: an error indicator * - * The @optarg value is that which accompanies the -seed argument. + * The @seedstr value is that which accompanies the -seed argument. * This forces qemu_guest_getrandom into deterministic mode. * * Returns 0 on success, < 0 on failure while setting *errp. */ -int qemu_guest_random_seed_main(const char *optarg, Error **errp); +int qemu_guest_random_seed_main(const char *seedstr, Error **errp); =20 /** * qemu_guest_random_seed_thread_part1(void) diff --git a/util/guest-random.c b/util/guest-random.c index 9465dda085..33607d5ff2 100644 --- a/util/guest-random.c +++ b/util/guest-random.c @@ -87,11 +87,11 @@ void qemu_guest_random_seed_thread_part2(uint64_t seed) } } =20 -int qemu_guest_random_seed_main(const char *optarg, Error **errp) +int qemu_guest_random_seed_main(const char *seedstr, Error **errp) { uint64_t seed; - if (parse_uint_full(optarg, 0, &seed)) { - error_setg(errp, "Invalid seed number: %s", optarg); + if (parse_uint_full(seedstr, 0, &seed)) { + error_setg(errp, "Invalid seed number: %s", seedstr); return -1; } else { deterministic =3D true; --=20 2.41.0 From nobody Sat May 18 15:08:28 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=1696592652; cv=none; d=zohomail.com; s=zohoarc; b=ZsTVQR5g0YBaxQRCNfPHGreF93ty1Uw4HRYu+YXpnwu73sJc8IGiJqt4QwZHH8IzFXizT/nURs2x7vCj5tsQwCi/0dYxYAKEsWV2qeeKZTc73393IzYpts6ex/XQl17TDrNTwnjDMmO1IbF4Z0m8rnbrsdStCCW52HSBKnFec8A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696592652; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=B7A1/6yu6677WxLat5yg/pN/jN8LiDjpr3rH9i+lSaQ=; b=B3ot2dUojgA6E/VYUYPeCkk1BbUCLphbnsWdmy+qM3yk/bxiQ9nryiBrMhDvgMzeOjzFbiE+utzo6f9kbpQIpcSK2BJ4TKy3M8LbBQe4V/Y4OX+6OU82wQawtu0NZqnVavzm49sP/mA/WPCmtM8UcpMTWMyLtUQPyACOAFHA0xI= 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 1696592652348413.92139601949; Fri, 6 Oct 2023 04:44:12 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoj9K-00059S-BS; Fri, 06 Oct 2023 07:37: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 1qoj8w-00051s-VV for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37: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 1qoj8t-0000A0-8V for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37:18 -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-388-BFMu70v_N3uHpPxO6vuk9g-1; Fri, 06 Oct 2023 07:37:01 -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 BAAD8185A797; Fri, 6 Oct 2023 11:37:00 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9A321215671F; Fri, 6 Oct 2023 11:37:00 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 9483121E6886; Fri, 6 Oct 2023 13:36:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696592232; 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=B7A1/6yu6677WxLat5yg/pN/jN8LiDjpr3rH9i+lSaQ=; b=RbwaSWx6yu7B5NF8rPPZfhjyYeLIf61AHtY0ujszE5kOzW8ryRqPQ99dk0vLz6moe1WHyY xmOtNjunOEuiSiHb/UbrVZLuI3vIuMH23cuJIpHu84uIZZcBTLq4dLXZHCoT9gscouGu+d 9/qYtr2g9UJsxJx5bF26swlucojNmOg= X-MC-Unique: BFMu70v_N3uHpPxO6vuk9g-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 22/32] semihosting/arm-compat: Clean up local variable shadowing Date: Fri, 6 Oct 2023 13:36:47 +0200 Message-ID: <20231006113657.3803180-23-armbru@redhat.com> In-Reply-To: <20231006113657.3803180-1-armbru@redhat.com> References: <20231006113657.3803180-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.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: 1696592654277100005 From: Philippe Mathieu-Daud=C3=A9 Fix: semihosting/arm-compat-semi.c: In function =E2=80=98do_common_semihosting= =E2=80=99: semihosting/arm-compat-semi.c:379:13: warning: declaration of =E2=80=98re= t=E2=80=99 shadows a previous local [-Wshadow=3Dlocal] 379 | int ret, err =3D 0; | ^~~ semihosting/arm-compat-semi.c:370:14: note: shadowed declaration is here 370 | uint32_t ret; | ^~~ semihosting/arm-compat-semi.c:682:27: warning: declaration of =E2=80=98re= t=E2=80=99 shadows a previous local [-Wshadow=3Dlocal] 682 | abi_ulong ret; | ^~~ semihosting/arm-compat-semi.c:370:9: note: shadowed declaration is here 370 | int ret; | ^~~ Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20231004120019.93101-14-philmd@linaro.org> Reviewed-by: Richard Henderson Signed-off-by: Markus Armbruster --- semihosting/arm-compat-semi.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/semihosting/arm-compat-semi.c b/semihosting/arm-compat-semi.c index 29c5670fdf..ec959b3e01 100644 --- a/semihosting/arm-compat-semi.c +++ b/semihosting/arm-compat-semi.c @@ -367,7 +367,6 @@ void do_common_semihosting(CPUState *cs) target_ulong ul_ret; char * s; int nr; - uint32_t ret; int64_t elapsed; =20 nr =3D common_semi_arg(cs, 0) & 0xffffffffU; @@ -725,6 +724,9 @@ void do_common_semihosting(CPUState *cs) =20 case TARGET_SYS_EXIT: case TARGET_SYS_EXIT_EXTENDED: + { + uint32_t ret; + if (common_semi_sys_exit_extended(cs, nr)) { /* * The A64 version of SYS_EXIT takes a parameter block, @@ -752,6 +754,7 @@ void do_common_semihosting(CPUState *cs) } gdb_exit(ret); exit(ret); + } =20 case TARGET_SYS_ELAPSED: elapsed =3D get_clock() - clock_start; --=20 2.41.0 From nobody Sat May 18 15:08:28 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=1696592399; cv=none; d=zohomail.com; s=zohoarc; b=ZFJJ0Q6oMfCTWpBc0CXV0wg6CWSBIZ/+nl3i63szJD4hBpFXoN20Pxr/msg+wtIlYTg9XLpYyNMmj/dlN3ZJL5SqDYtefRTFRQuY4i6RxQTMbq1q5VEX3IMw3fMBxAWyQ/TY1BtM2LSRVfWYdQcdg6HJlSsQnaBBZJiDwxPJZSQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696592399; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Dp18yDfa0xSGbMJbUgqL8hFOVcmn22n/M/o33Bq6pZ0=; b=MuqoZJ4Tq0v1THAzTq3MmfWSANnpyBL4T9HPJsbZsaKIQgWPTEajx5B0o2xCuUdyZhinAzYD463AzyBXfVp+ODCOCWSWuWzfk7hpmflWIUI25Zi6emWPiYo61oIP5h+pD7ZchlKobx3mdkJOjrQ5YIPOR4tTXGR72NgUl5XKqoI= 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 1696592399496611.6072439763541; Fri, 6 Oct 2023 04:39:59 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoj9T-0005D8-Cv; Fri, 06 Oct 2023 07:37:51 -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 1qoj93-00053B-0O for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37: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 1qoj8u-00008g-0Q for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37: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-571-QtCohzAOPA6tYsfsq0Ty-Q-1; Fri, 06 Oct 2023 07:37:01 -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 DC039858F1C; Fri, 6 Oct 2023 11:37:00 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9FC8A140E963; Fri, 6 Oct 2023 11:37:00 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 9766821E6887; Fri, 6 Oct 2023 13:36:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696592227; 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=Dp18yDfa0xSGbMJbUgqL8hFOVcmn22n/M/o33Bq6pZ0=; b=hihujg3d4DHhLlA+F13p3bAIWAqtv/4LaC0mb0zjipbhbqBRKSMVBZPmg6lpnBI6J3Weae 3K2ScDJT4RhNahry79ILO4yqnHUE7ciftqjTq4oKgGVUzRkPP5AoybZCmvC8umQZfDVi/p ozD9Bs9w/Jh0QhgTvW5qre02ZeBDj5Y= X-MC-Unique: QtCohzAOPA6tYsfsq0Ty-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 23/32] softmmu/vl: Clean up global variable shadowing Date: Fri, 6 Oct 2023 13:36:48 +0200 Message-ID: <20231006113657.3803180-24-armbru@redhat.com> In-Reply-To: <20231006113657.3803180-1-armbru@redhat.com> References: <20231006113657.3803180-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: 1696592401376100001 From: Philippe Mathieu-Daud=C3=A9 Fix: softmmu/vl.c:1069:44: error: declaration shadows a variable in the global= scope [-Werror,-Wshadow] static void parse_display_qapi(const char *optarg) ^ softmmu/vl.c:1224:39: error: declaration shadows a variable in the global= scope [-Werror,-Wshadow] static void monitor_parse(const char *optarg, const char *mode, bool pret= ty) ^ softmmu/vl.c:1634:17: error: declaration shadows a variable in the global= scope [-Werror,-Wshadow] const char *optarg =3D qdict_get_try_str(qdict, "type"); ^ softmmu/vl.c:1784:45: error: declaration shadows a variable in the global= scope [-Werror,-Wshadow] static void object_option_parse(const char *optarg) ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/getopt.h:= 77:14: note: previous declaration is here extern char *optarg; /* getopt(3) external variables */ ^ Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20231004120019.93101-15-philmd@linaro.org> Reviewed-by: Richard Henderson Reviewed-by: Markus Armbruster [Tweak two parameter names] Signed-off-by: Markus Armbruster --- softmmu/vl.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/softmmu/vl.c b/softmmu/vl.c index 98e071e63b..13c1b24706 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -1066,12 +1066,12 @@ static void select_vgahw(const MachineClass *machin= e_class, const char *p) } } =20 -static void parse_display_qapi(const char *optarg) +static void parse_display_qapi(const char *str) { DisplayOptions *opts; Visitor *v; =20 - v =3D qobject_input_visitor_new_str(optarg, "type", &error_fatal); + v =3D qobject_input_visitor_new_str(str, "type", &error_fatal); =20 visit_type_DisplayOptions(v, NULL, &opts, &error_fatal); QAPI_CLONE_MEMBERS(DisplayOptions, &dpy, opts); @@ -1221,21 +1221,21 @@ static int mon_init_func(void *opaque, QemuOpts *op= ts, Error **errp) return monitor_init_opts(opts, errp); } =20 -static void monitor_parse(const char *optarg, const char *mode, bool prett= y) +static void monitor_parse(const char *str, const char *mode, bool pretty) { static int monitor_device_index =3D 0; QemuOpts *opts; const char *p; char label[32]; =20 - if (strstart(optarg, "chardev:", &p)) { + if (strstart(str, "chardev:", &p)) { snprintf(label, sizeof(label), "%s", p); } else { snprintf(label, sizeof(label), "compat_monitor%d", monitor_device_index); - opts =3D qemu_chr_parse_compat(label, optarg, true); + opts =3D qemu_chr_parse_compat(label, str, true); if (!opts) { - error_report("parse error: %s", optarg); + error_report("parse error: %s", str); exit(1); } } @@ -1631,13 +1631,13 @@ static const QEMUOption *lookup_opt(int argc, char = **argv, =20 static MachineClass *select_machine(QDict *qdict, Error **errp) { - const char *optarg =3D qdict_get_try_str(qdict, "type"); + const char *machine_type =3D qdict_get_try_str(qdict, "type"); GSList *machines =3D object_class_get_list(TYPE_MACHINE, false); MachineClass *machine_class; Error *local_err =3D NULL; =20 - if (optarg) { - machine_class =3D find_machine(optarg, machines); + if (machine_type) { + machine_class =3D find_machine(machine_type, machines); qdict_del(qdict, "type"); if (!machine_class) { error_setg(&local_err, "unsupported machine type"); @@ -1781,20 +1781,20 @@ static void object_option_add_visitor(Visitor *v) QTAILQ_INSERT_TAIL(&object_opts, opt, next); } =20 -static void object_option_parse(const char *optarg) +static void object_option_parse(const char *str) { QemuOpts *opts; const char *type; Visitor *v; =20 - if (optarg[0] =3D=3D '{') { - QObject *obj =3D qobject_from_json(optarg, &error_fatal); + if (str[0] =3D=3D '{') { + QObject *obj =3D qobject_from_json(str, &error_fatal); =20 v =3D qobject_input_visitor_new(obj); qobject_unref(obj); } else { opts =3D qemu_opts_parse_noisily(qemu_find_opts("object"), - optarg, true); + str, true); if (!opts) { exit(1); } --=20 2.41.0 From nobody Sat May 18 15:08:28 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=1696592359; cv=none; d=zohomail.com; s=zohoarc; b=NTTqengPJuI4TMA4Z/wbG/TH3EtaHoY7LgH9JTm9cNymIsMgnlN7SKVSJemQ2PK3n5h6DTfn5qP+WF6SWJSV4OZ4DLIC9OoQD40EiEHvS0FrAZA3bIISkZI43DPcafqc+ch6BE46cO/2FMTmv3Q7YeX0m4YkddkuFxy4RRgUrCk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696592359; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=GGCzqdXxW4X7LjlOPUJQlBqL1VydtpWMZvfIPJEozd4=; b=KDNrokEkyHOwrtgyc19TBR3vG4G7C2K9WFqt64OeF/JNlq5wJ7qezarOf8H8DvGpD6GHfDIUZEsi+mU3gx4utHnMfia5AJOCLygSiFt7kyeCQR/QIX4iC5+/e73D9fVPMKp0oq+aMb43StiEHGOBm3JaiOjDNkaFrWEiGsJMK3I= 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 1696592359065577.3241274313735; Fri, 6 Oct 2023 04:39:19 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoj9U-0005E0-Mf; Fri, 06 Oct 2023 07:37: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 1qoj8x-00051v-1D for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37:19 -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 1qoj8t-00007q-9K for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37: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-65-xYxz1MWhNaiNUzSPpw65Pg-1; Fri, 06 Oct 2023 07:37:01 -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 C53C529A9D43; Fri, 6 Oct 2023 11:37:00 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A1367C15BB8; Fri, 6 Oct 2023 11:37:00 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 9A54421E6888; Fri, 6 Oct 2023 13:36:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696592224; 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=GGCzqdXxW4X7LjlOPUJQlBqL1VydtpWMZvfIPJEozd4=; b=IO6v/3w8tYnhGekNJRXt9j/+l5BjF0rU2pfHkZFUIKpx5n4GXJe+/qZ3fhcYx68BHx+WcW Q0ISAwcjaWrtieL/X+j49kbx+a9Mciddph7jtA+EoqZ4ty7R8b3XN+xaR1llDoFloh6HN8 IMx+2juLjwFSEC7fv4PIoxpqnfSfbMc= X-MC-Unique: xYxz1MWhNaiNUzSPpw65Pg-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Stefan Berger , Richard Henderson Subject: [PULL 24/32] sysemu/tpm: Clean up global variable shadowing Date: Fri, 6 Oct 2023 13:36:49 +0200 Message-ID: <20231006113657.3803180-25-armbru@redhat.com> In-Reply-To: <20231006113657.3803180-1-armbru@redhat.com> References: <20231006113657.3803180-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: 1696592360576100004 From: Philippe Mathieu-Daud=C3=A9 Fix: softmmu/tpm.c:178:59: error: declaration shadows a variable in the global= scope [-Werror,-Wshadow] int tpm_config_parse(QemuOptsList *opts_list, const char *optarg) ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/getopt.h:= 77:14: note: previous declaration is here extern char *optarg; /* getopt(3) external variables */ ^ Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20231004120019.93101-16-philmd@linaro.org> Reviewed-by: Stefan Berger Reviewed-by: Richard Henderson Signed-off-by: Markus Armbruster --- include/sysemu/tpm.h | 2 +- softmmu/tpm.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/sysemu/tpm.h b/include/sysemu/tpm.h index 66e3b45f30..1ee568b3b6 100644 --- a/include/sysemu/tpm.h +++ b/include/sysemu/tpm.h @@ -17,7 +17,7 @@ =20 #ifdef CONFIG_TPM =20 -int tpm_config_parse(QemuOptsList *opts_list, const char *optarg); +int tpm_config_parse(QemuOptsList *opts_list, const char *optstr); int tpm_init(void); void tpm_cleanup(void); =20 diff --git a/softmmu/tpm.c b/softmmu/tpm.c index 578563f05a..7164ea7ff1 100644 --- a/softmmu/tpm.c +++ b/softmmu/tpm.c @@ -175,15 +175,15 @@ int tpm_init(void) * Parse the TPM configuration options. * To display all available TPM backends the user may use '-tpmdev help' */ -int tpm_config_parse(QemuOptsList *opts_list, const char *optarg) +int tpm_config_parse(QemuOptsList *opts_list, const char *optstr) { QemuOpts *opts; =20 - if (!strcmp(optarg, "help")) { + if (!strcmp(optstr, "help")) { tpm_display_backend_drivers(); return -1; } - opts =3D qemu_opts_parse_noisily(opts_list, optarg, true); + opts =3D qemu_opts_parse_noisily(opts_list, optstr, true); if (!opts) { return -1; } --=20 2.41.0 From nobody Sat May 18 15:08:28 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=1696592652; cv=none; d=zohomail.com; s=zohoarc; b=ggomHJY8kd19zPR3TtWlN4DF0xmzfjuXHktbHnb95DccBMbk+rifq9+ZcDPl4B6rLsc2+0efKtqUA59u+1wewcCG/u8+wEgG2dNaichN9NO7+jE87/+FEuGQWBxjOh++RBYHoMddVhczSRJCsd8YLqgKQtN1QZuFu/co6xSUaAI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696592652; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=z+R5zaDK5SKD1cw+72zd9/gWLPUgkdgnoxFy8d3lUu8=; b=MXfKt+MQr44Cm8G9THksHYPoBalir+a23E3UcVIrK+Mbh6vSA0kp4QGSdvBG5WwKH+FyfuOjSIoEvTX+hcjUQPFDQgggc2A2WyRxiTPIxg0f9UmZPj0QNm9CIjyn2XEIGFK2JlOjIZMMT4Ht6dbN50NrwvUoy2md/0nRY6hk5WU= 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 1696592652339262.40497840391015; Fri, 6 Oct 2023 04:44:12 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoj9Q-0005BT-65; Fri, 06 Oct 2023 07:37:48 -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 1qoj90-000531-3Y for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37:24 -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 1qoj8t-0000Az-Vn for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37:19 -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-418-EUOtDV6VPkeRLdOqQZeeaQ-1; Fri, 06 Oct 2023 07:37:01 -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 D795F800045; Fri, 6 Oct 2023 11:37:00 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A99C5170EE; Fri, 6 Oct 2023 11:37:00 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 9D43B21E688A; Fri, 6 Oct 2023 13:36:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696592234; 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=z+R5zaDK5SKD1cw+72zd9/gWLPUgkdgnoxFy8d3lUu8=; b=AdJlP6YW4PaRR0bwES2lQbIboDzVr/Z3chHBvUmLfdDERQgLMvt6SEJg6ON/GZYo6K/kd0 5mfa01unda9uWchhbxkd+n3RbIUwEMoi1h2vABjtdqiabkKQBND4HbtX694HlLBAh0k9sD REUZ8pvfQ4OtOuEpSORvTbC9ip1vixg= X-MC-Unique: EUOtDV6VPkeRLdOqQZeeaQ-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 25/32] trace/control: Clean up global variable shadowing Date: Fri, 6 Oct 2023 13:36:50 +0200 Message-ID: <20231006113657.3803180-26-armbru@redhat.com> In-Reply-To: <20231006113657.3803180-1-armbru@redhat.com> References: <20231006113657.3803180-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, 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: 1696592654284100006 From: Philippe Mathieu-Daud=C3=A9 Fix: trace/control.c:288:34: error: declaration shadows a variable in the glob= al scope [-Werror,-Wshadow] void trace_opt_parse(const char *optarg) ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/getopt.h:= 77:14: note: previous declaration is here extern char *optarg; /* getopt(3) external variables */ ^ Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20231004120019.93101-17-philmd@linaro.org> Reviewed-by: Stefan Hajnoczi Reviewed-by: Richard Henderson Signed-off-by: Markus Armbruster --- trace/control.h | 4 ++-- trace/control.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/trace/control.h b/trace/control.h index dfd209edd8..6754bfe052 100644 --- a/trace/control.h +++ b/trace/control.h @@ -197,11 +197,11 @@ extern QemuOptsList qemu_trace_opts; =20 /** * trace_opt_parse: - * @optarg: A string argument of --trace command line argument + * @optstr: A string argument of --trace command line argument * * Initialize tracing subsystem. */ -void trace_opt_parse(const char *optarg); +void trace_opt_parse(const char *optstr); =20 /** * trace_get_vcpu_event_count: diff --git a/trace/control.c b/trace/control.c index 1a48a7e266..ef107829ac 100644 --- a/trace/control.c +++ b/trace/control.c @@ -285,10 +285,10 @@ bool trace_init_backends(void) return true; } =20 -void trace_opt_parse(const char *optarg) +void trace_opt_parse(const char *optstr) { QemuOpts *opts =3D qemu_opts_parse_noisily(qemu_find_opts("trace"), - optarg, true); + optstr, true); if (!opts) { exit(1); } --=20 2.41.0 From nobody Sat May 18 15:08:28 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=1696592591; cv=none; d=zohomail.com; s=zohoarc; b=QGuMukL6yNdLBdJqi0tYujMjE7WvkGX9ATksHb5/W2Bp6U0m6HLLau0XCxOv9BQfOcZQ1RR9GAGt6like/tTZ33oJ8J1DNUvIpTGgOpq2D7EArAKr/CHJSP65tiZ/+9dMYVUwzkhSzvuVmmvqVN45Kcxh1QYZlWdEw2JFFG24hw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696592591; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=W1hnDXW2G2X0jAZGXXZDFrzGECJyj0Qbki6Nvcz3AA0=; b=CU//7USSxvkFnHOSd/ySIO973mQcKtvq/UcPsIl/wzJEHC1D/N7wfeMzO2quelwxei/b+x64JcLyGT+n/p6RwGjt2bXb/91ntjnuYEBfsxSAZVSOy+//22dqDuN6zXHM9B/svGPpiRZA5yG+qiFODpZdZYPOzVrtHrujp5SHAk4= 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 1696592591051706.4070639451776; Fri, 6 Oct 2023 04:43:11 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoj9D-000556-HG; Fri, 06 Oct 2023 07:37: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 1qoj8q-0004zq-M0 for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37: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 1qoj8j-00006s-Fz for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37: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-388-ZOkZ6c17NgGHXmD9UnqjXg-1; Fri, 06 Oct 2023 07:37:01 -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 D78A518175A2; Fri, 6 Oct 2023 11:37:00 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B29061054FC3; Fri, 6 Oct 2023 11:37:00 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id A002A21E688B; Fri, 6 Oct 2023 13:36:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696592222; 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=W1hnDXW2G2X0jAZGXXZDFrzGECJyj0Qbki6Nvcz3AA0=; b=We0HaNkn8iGdffPJ8r5CgENe7mOc6K4rwQY7DWz0hASI9ofTHQvAFd9dLhaDCsjUsvd6KQ 6Dckp/G3YiBLN2vAdoxAa8/5ZcSouLFIDT+uBRVvBmSxwOPHS61sfGHjaY35t3oLiJxPem ybrXB1b1pBLf9PxOXQoCIrfi7bCIvTk= X-MC-Unique: ZOkZ6c17NgGHXmD9UnqjXg-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Thomas Huth Subject: [PULL 26/32] target/ppc: Clean up local variable shadowing in kvm_arch_*_registers() Date: Fri, 6 Oct 2023 13:36:51 +0200 Message-ID: <20231006113657.3803180-27-armbru@redhat.com> In-Reply-To: <20231006113657.3803180-1-armbru@redhat.com> References: <20231006113657.3803180-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.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: 1696592593238100009 From: C=C3=A9dric Le Goater Remove extra 'i' variable to fix this warning : ../target/ppc/kvm.c: In function =E2=80=98kvm_arch_put_registers=E2=80=99: ../target/ppc/kvm.c:963:13: warning: declaration of =E2=80=98i=E2=80=99 s= hadows a previous local [-Wshadow=3Dcompatible-local] 963 | int i; | ^ ../target/ppc/kvm.c:906:9: note: shadowed declaration is here 906 | int i; | ^ ../target/ppc/kvm.c: In function =E2=80=98kvm_arch_get_registers=E2=80=99: ../target/ppc/kvm.c:1265:13: warning: declaration of =E2=80=98i=E2=80=99 = shadows a previous local [-Wshadow=3Dcompatible-local] 1265 | int i; | ^ ../target/ppc/kvm.c:1212:9: note: shadowed declaration is here 1212 | int i, ret; | ^ Signed-off-by: C=C3=A9dric Le Goater Message-ID: <20231006053526.1031252-1-clg@kaod.org> Reviewed-by: Thomas Huth Signed-off-by: Markus Armbruster --- target/ppc/kvm.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c index 51112bd367..d0e2dcdc77 100644 --- a/target/ppc/kvm.c +++ b/target/ppc/kvm.c @@ -960,8 +960,6 @@ int kvm_arch_put_registers(CPUState *cs, int level) } =20 if (cap_one_reg) { - int i; - /* * We deliberately ignore errors here, for kernels which have * the ONE_REG calls, but don't support the specific @@ -1262,8 +1260,6 @@ int kvm_arch_get_registers(CPUState *cs) } =20 if (cap_one_reg) { - int i; - /* * We deliberately ignore errors here, for kernels which have * the ONE_REG calls, but don't support the specific --=20 2.41.0 From nobody Sat May 18 15:08:28 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=1696592326; cv=none; d=zohomail.com; s=zohoarc; b=ITfRBDI4K81UkFgsjOpkynx2BDo4lQHFeY2mwlm4uku1PDvgbb9iboNteU20Z7kltbj3bWz2Bynku65H4vmH/W3QLsJwZoc6yX3sCDLTdBbNz3259Wlwvh89NImFrdtD3VpRojtlKLHkwAXytEEgC24PSJbMF/iSZNVrHBdJPLE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696592326; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=MGDOli7FXeH7i5r+mSGo0hb7GPl8gp7Ho6dYDlXIsy8=; b=D24tYHu6hWDaR+kSAPQ8LNOBfIo0DK5IK858OUlOvZ1pASS8Znl6jh1Q3vflOgbIkpu2weWLgsnG0aA/3aRbSvwIDAorgF8mmiQTafOE7c8vF9RuU2hEkvbZhEPocPY86+9te+C+ec5BXSqNiUEeuog50q4RvZm5Mr/F2FwS1SM= 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 1696592326204274.01559386863687; Fri, 6 Oct 2023 04:38:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoj9C-000553-W5; Fri, 06 Oct 2023 07:37: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 1qoj8o-0004zI-DC for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37: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 1qoj8j-00006u-2I for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37: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-668-EmZUMq1KMrOAXhZ1HvkgZQ-1; Fri, 06 Oct 2023 07:37:01 -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 EDC2D3827DEC; Fri, 6 Oct 2023 11:37:00 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B16DA202696C; Fri, 6 Oct 2023 11:37:00 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id A408B21E688D; Fri, 6 Oct 2023 13:36:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696592222; 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=MGDOli7FXeH7i5r+mSGo0hb7GPl8gp7Ho6dYDlXIsy8=; b=TZ3iTuXWMuekf6BTyHXKV9+55qI8HoF/+NwKfOAY/IL/rpLzGojViHuCdyQcfY+ojGNAsK 9PHju5gIfbf8rZUC0CT7e7l9GSHlFLVyE+xMrH3dCAD0IdY2RdczwZjHrVD7TyO84SgLe8 ziPxR/75J+bStsiXAmd1W4bZ5/t4ltY= X-MC-Unique: EmZUMq1KMrOAXhZ1HvkgZQ-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, Thomas Huth , Michael Tokarev Subject: [PULL 27/32] hw/usb: Silence compiler warnings in USB code when compiling with -Wshadow Date: Fri, 6 Oct 2023 13:36:52 +0200 Message-ID: <20231006113657.3803180-28-armbru@redhat.com> In-Reply-To: <20231006113657.3803180-1-armbru@redhat.com> References: <20231006113657.3803180-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, 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: 1696592327947100003 Content-Type: text/plain; charset="utf-8" From: Thomas Huth Rename variables or remove nested definitions where it makes sense, so that we can finally compile the USB code with "-Wshadow", too. Signed-off-by: Thomas Huth Message-ID: <20231004130822.113343-1-thuth@redhat.com> Reviewed-by: Michael Tokarev Signed-off-by: Markus Armbruster --- hw/usb/desc.c | 2 +- hw/usb/dev-hub.c | 8 ++++---- hw/usb/dev-storage.c | 6 +++--- hw/usb/hcd-xhci.c | 10 +++++----- hw/usb/host-libusb.c | 2 +- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/hw/usb/desc.c b/hw/usb/desc.c index 7f6cc2f99b..f2bdc05a95 100644 --- a/hw/usb/desc.c +++ b/hw/usb/desc.c @@ -227,7 +227,7 @@ int usb_desc_endpoint(const USBDescEndpoint *ep, int fl= ags, } =20 if (superlen) { - USBDescriptor *d =3D (void *)(dest + bLength); + d =3D (void *)(dest + bLength); =20 d->bLength =3D 0x06; d->bDescriptorType =3D USB_DT_ENDPOINT_COMPANION; diff --git a/hw/usb/dev-hub.c b/hw/usb/dev-hub.c index a6b50dbc8d..5703e0e826 100644 --- a/hw/usb/dev-hub.c +++ b/hw/usb/dev-hub.c @@ -402,7 +402,7 @@ static void usb_hub_handle_control(USBDevice *dev, USBP= acket *p, { unsigned int n =3D index - 1; USBHubPort *port; - USBDevice *dev; + USBDevice *pdev; =20 trace_usb_hub_set_port_feature(s->dev.addr, index, feature_name(value)); @@ -411,7 +411,7 @@ static void usb_hub_handle_control(USBDevice *dev, USBP= acket *p, goto fail; } port =3D &s->ports[n]; - dev =3D port->port.dev; + pdev =3D port->port.dev; switch(value) { case PORT_SUSPEND: port->wPortStatus |=3D PORT_STAT_SUSPEND; @@ -419,8 +419,8 @@ static void usb_hub_handle_control(USBDevice *dev, USBP= acket *p, case PORT_RESET: usb_hub_port_set(port, PORT_STAT_RESET); usb_hub_port_clear(port, PORT_STAT_RESET); - if (dev && dev->attached) { - usb_device_reset(dev); + if (pdev && pdev->attached) { + usb_device_reset(pdev); usb_hub_port_set(port, PORT_STAT_ENABLE); } usb_wakeup(s->intr, 0); diff --git a/hw/usb/dev-storage.c b/hw/usb/dev-storage.c index e3bcffb3e0..a496c811a7 100644 --- a/hw/usb/dev-storage.c +++ b/hw/usb/dev-storage.c @@ -403,7 +403,7 @@ static void usb_msd_handle_data(USBDevice *dev, USBPack= et *p) struct usb_msd_cbw cbw; uint8_t devep =3D p->ep->nr; SCSIDevice *scsi_dev; - uint32_t len; + int len; =20 if (s->needs_reset) { p->status =3D USB_RET_STALL; @@ -465,7 +465,7 @@ static void usb_msd_handle_data(USBDevice *dev, USBPack= et *p) usb_msd_copy_data(s, p); } if (le32_to_cpu(s->csw.residue)) { - int len =3D p->iov.size - p->actual_length; + len =3D p->iov.size - p->actual_length; if (len) { usb_packet_skip(p, len); if (len > s->data_len) { @@ -526,7 +526,7 @@ static void usb_msd_handle_data(USBDevice *dev, USBPack= et *p) usb_msd_copy_data(s, p); } if (le32_to_cpu(s->csw.residue)) { - int len =3D p->iov.size - p->actual_length; + len =3D p->iov.size - p->actual_length; if (len) { usb_packet_skip(p, len); if (len > s->data_len) { diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c index 324177ad5d..4b60114207 100644 --- a/hw/usb/hcd-xhci.c +++ b/hw/usb/hcd-xhci.c @@ -217,10 +217,10 @@ enum { (((data) >> field##_SHIFT) & field##_MASK) =20 #define set_field(data, newval, field) do { \ - uint32_t val =3D *data; \ - val &=3D ~(field##_MASK << field##_SHIFT); \ - val |=3D ((newval) & field##_MASK) << field##_SHIFT; \ - *data =3D val; \ + uint32_t val_ =3D *data; \ + val_ &=3D ~(field##_MASK << field##_SHIFT); \ + val_ |=3D ((newval) & field##_MASK) << field##_SHIFT; \ + *data =3D val_; \ } while (0) =20 typedef enum EPType { @@ -1894,7 +1894,7 @@ static void xhci_kick_epctx(XHCIEPContext *epctx, uns= igned int streamid) } =20 if (epctx->retry) { - XHCITransfer *xfer =3D epctx->retry; + xfer =3D epctx->retry; =20 trace_usb_xhci_xfer_retry(xfer); assert(xfer->running_retry); diff --git a/hw/usb/host-libusb.c b/hw/usb/host-libusb.c index f500db85ab..d7060a42d5 100644 --- a/hw/usb/host-libusb.c +++ b/hw/usb/host-libusb.c @@ -1010,7 +1010,7 @@ static int usb_host_open(USBHostDevice *s, libusb_dev= ice *dev, int hostfd) * Speeds are defined in linux/usb/ch9.h, file not included * due to name conflicts. */ - int rc =3D ioctl(hostfd, USBDEVFS_GET_SPEED, NULL); + rc =3D ioctl(hostfd, USBDEVFS_GET_SPEED, NULL); switch (rc) { case 1: /* low */ libusb_speed =3D LIBUSB_SPEED_LOW; --=20 2.41.0 From nobody Sat May 18 15:08:28 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=1696592589; cv=none; d=zohomail.com; s=zohoarc; b=DIB6kO0uiGrQvtt2qMfxQfLCUwi4thSE1iuVevjOAaqj0mHF2j8Rxz275fg1b6IGzxQw9dMaLY10KEht2Yr9YqescrhAgeJ3N5lOqvRF3ntwrOMNIb9cixGjyqjVJBRQfl1EGggKcbPkBa1+e1CNb/YPsOAK87rp13u0+mumr4s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696592589; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=0dtR46yIS7jXolrgD1WN+gaptLFT0kHhKgLq1QGGCo0=; b=FjegL70sZdOuV0wO8sSq2THsnH9BFdsYdjZyzYQGrQ/fGs9vh0b6wt9qUFcaBa2gMIMOZiOWSAc5aCE28F9/qkk0AR+1aC2LMtFLZLhLp3f+o7cmzdURp9BzsTP6wAviwJyT+0dzdJjFnxOMgTwFxGJDt/9SFeVAVJM2Wpo/C8A= 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 1696592589489497.79257276398596; Fri, 6 Oct 2023 04:43:09 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoj9Q-0005BR-5K; Fri, 06 Oct 2023 07:37:48 -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 1qoj93-00053A-03 for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37:26 -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 1qoj8z-0000EG-00 for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37: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-402-q2-fD7H_NrOTxltfrv0DvQ-1; Fri, 06 Oct 2023 07:37:01 -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 F0234811E7E; Fri, 6 Oct 2023 11:37:00 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BC3F4140E964; Fri, 6 Oct 2023 11:37:00 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id A5A2B21E6890; Fri, 6 Oct 2023 13:36:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696592239; 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=0dtR46yIS7jXolrgD1WN+gaptLFT0kHhKgLq1QGGCo0=; b=eTOzGT5Sor6ltL5OesStRPoCFl0lojXJ5NOgGCIHBMXc89FyozaTDKH+lxpYxKbO2HUQ7p WyqPZNYv4tg9ig/974DwocfSb5xl2At020q4E0HSf5+eVeURNmA7SklV7j/6Fay3xa/UHq xj9g670dEbk3A1bxDuBDQqzAwz+5OQM= X-MC-Unique: q2-fD7H_NrOTxltfrv0DvQ-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, Laurent Vivier , Thomas Huth Subject: [PULL 28/32] linux-user/flatload: clean up local variable shadowing Date: Fri, 6 Oct 2023 13:36:53 +0200 Message-ID: <20231006113657.3803180-29-armbru@redhat.com> In-Reply-To: <20231006113657.3803180-1-armbru@redhat.com> References: <20231006113657.3803180-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.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: 1696592591194100003 Content-Type: text/plain; charset="utf-8" From: Laurent Vivier Fix following warnings: .../linux-user/flatload.c: In function 'load_flt_binary': .../linux-user/flatload.c:758:23: warning: declaration of 'p' shadows a pre= vious local [-Wshadow=3Dcompatible-local] 758 | abi_ulong p; | ^ ../../../Projects/qemu/linux-user/flatload.c:722:15: note: shadowed declara= tion is here 722 | abi_ulong p; | ^ Signed-off-by: Laurent Vivier Message-ID: <20230925151029.461358-2-laurent@vivier.eu> Reviewed-by: Thomas Huth Signed-off-by: Markus Armbruster --- linux-user/flatload.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/linux-user/flatload.c b/linux-user/flatload.c index 4331a11bf0..fdcc4610fa 100644 --- a/linux-user/flatload.c +++ b/linux-user/flatload.c @@ -755,15 +755,15 @@ int load_flt_binary(struct linux_binprm *bprm, struct= image_info *info) /* Update data segment pointers for all libraries */ for (i=3D0; i (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 1696592569705500.0066676375732; Fri, 6 Oct 2023 04:42:49 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoj9L-0005AA-EZ; Fri, 06 Oct 2023 07:37:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qoj91-000536-53 for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37:24 -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 1qoj8u-0000At-06 for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37: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-402-1YUzYP4kNvCsMiv_16ESyg-1; Fri, 06 Oct 2023 07:37:01 -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 F3B25803D6A; Fri, 6 Oct 2023 11:37:00 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D37F863F46; Fri, 6 Oct 2023 11:37:00 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id A8BC021E6892; Fri, 6 Oct 2023 13:36:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696592234; 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=JIOyFaY/QbKQ6FUrXSBQAI+VMkM1XrPbnGAUCmyopoM=; b=DAfQxFDja3gh6mIvIj68b+5/aiCz+1ghOqq8+b70cdvgScIEXxk41woZFC3ZlsoE+smL6N FKskLxMgMq2qrf5iuzSToEMhLLFy8c48wU9CrsqcdUxXj7WN5m3P0cAveKQhx9yUeHTpL+ WJ4BOFiZdhqymo1vCfrWqxELvyuWkL0= X-MC-Unique: 1YUzYP4kNvCsMiv_16ESyg-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, Laurent Vivier , Thomas Huth Subject: [PULL 29/32] linux-user/mmap.c: clean up local variable shadowing Date: Fri, 6 Oct 2023 13:36:54 +0200 Message-ID: <20231006113657.3803180-30-armbru@redhat.com> In-Reply-To: <20231006113657.3803180-1-armbru@redhat.com> References: <20231006113657.3803180-1-armbru@redhat.com> MIME-Version: 1.0 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, 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: 1696592570784100006 Content-Type: text/plain; charset="utf-8" From: Laurent Vivier Fix following warnings: .../linux-user/mmap.c: In function 'target_mremap': .../linux-user/mmap.c:913:13: warning: declaration of 'prot' shadows a prev= ious local [-Wshadow=3Dcompatible-local] 913 | int prot =3D 0; | ^~~~ ../../../Projects/qemu/linux-user/mmap.c:871:9: note: shadowed declaration = is here 871 | int prot; | ^~~~ Signed-off-by: Laurent Vivier Message-ID: <20230925151029.461358-3-laurent@vivier.eu> Reviewed-by: Thomas Huth Signed-off-by: Markus Armbruster --- linux-user/mmap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/linux-user/mmap.c b/linux-user/mmap.c index 8eaf57b208..8ccaab7859 100644 --- a/linux-user/mmap.c +++ b/linux-user/mmap.c @@ -910,16 +910,16 @@ abi_long target_mremap(abi_ulong old_addr, abi_ulong = old_size, } } } else { - int prot =3D 0; + int page_flags =3D 0; if (reserved_va && old_size < new_size) { abi_ulong addr; for (addr =3D old_addr + old_size; addr < old_addr + new_size; addr++) { - prot |=3D page_get_flags(addr); + page_flags |=3D page_get_flags(addr); } } - if (prot =3D=3D 0) { + if (page_flags =3D=3D 0) { host_addr =3D mremap(g2h_untagged(old_addr), old_size, new_size, flags); =20 --=20 2.41.0 From nobody Sat May 18 15:08:28 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=1696592565; cv=none; d=zohomail.com; s=zohoarc; b=VcJzZf3lmSGZjJyShxAGGYZHF5imDSe7ziJ5F3G8/HsdIVDcXCMwk65So5ljvy1ZguSCuH7BfVbLZORGOAdST6iE8CeHtCXCfmqSXk0ZwV7TYg3qN+yzmSBcbjz+FH6EuZefLBJ+IzExFIXmhEG0KBYMapHf1Imhex4vOQM+vD0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696592565; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=fX6Z/GVlWWFVTgEr4OP0izgwtLk4sbJJBFiTtU8kar4=; b=l9FCm+8LxuirfJz2UgBvF2I6vu6r9Ek1s/X3+MjclIQx/oECxtNouxhwkkkUtaQc5XaHMM2v9YzTRmyMEQk8eJ0n+B9k8xRDFCZPwpyzKjDo8d6M3Wi9D4QoOJRqXWlN2wXi8mTqKwPJjMjhIXS4C1LOPl7DnepmEPCsBkgZVFg= 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 1696592565838173.9214066764962; Fri, 6 Oct 2023 04:42:45 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoj9K-00059Q-8E; Fri, 06 Oct 2023 07:37: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 1qoj8t-00050j-Iz for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37: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 1qoj8m-00007A-Fb for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37: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-571-ql0YyHVqPT6QCByByGSPWA-1; Fri, 06 Oct 2023 07:37:01 -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 18E8281D782; Fri, 6 Oct 2023 11:37:01 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C47024A9B0A; Fri, 6 Oct 2023 11:37:00 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id ABA1221E6893; Fri, 6 Oct 2023 13:36:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696592222; 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=fX6Z/GVlWWFVTgEr4OP0izgwtLk4sbJJBFiTtU8kar4=; b=FCv4/OxsMyZ/KlaOPbwLnwPAG57KT27w770rSXQ14N/eLLu8dMKhQYtwMZVFyf4fvu16du gs7koKucotV5o7Q5jqMz2KlIO2YLFNCAiwTPQTHsZbVi2omHuN0GPokUNVlFhJ+NlRcITi Oc7N2+vC0Xz9tj+av0hiAnUWbw+bg+M= X-MC-Unique: ql0YyHVqPT6QCByByGSPWA-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, Laurent Vivier , Thomas Huth Subject: [PULL 30/32] linux-user/syscall.c: clean up local variable shadowing in do_ioctl_dm() Date: Fri, 6 Oct 2023 13:36:55 +0200 Message-ID: <20231006113657.3803180-31-armbru@redhat.com> In-Reply-To: <20231006113657.3803180-1-armbru@redhat.com> References: <20231006113657.3803180-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: 1696592566735100003 Content-Type: text/plain; charset="utf-8" From: Laurent Vivier Fix following warnings: .../linux-user/syscall.c: In function 'do_ioctl_dm': .../linux-user/syscall.c:5053:23: warning: declaration of 'arg_type' shadow= s a previous local [-Wshadow=3Dlocal] 5053 | const argtype arg_type[] =3D { MK_STRUCT(STRUCT_dm_target_s= pec) }; | ^~~~~~~~ .../linux-user/syscall.c:4991:20: note: shadowed declaration is here 4991 | const argtype *arg_type =3D ie->arg_type; | ^~~~~~~~ ...//linux-user/syscall.c:5102:27: warning: declaration of 'arg_type' shado= ws a previous local [-Wshadow=3Dlocal] 5102 | const argtype arg_type[] =3D { MK_STRUCT(STRUCT_dm_name= _list) }; | ^~~~~~~~ .../linux-user/syscall.c:4991:20: note: shadowed declaration is here 4991 | const argtype *arg_type =3D ie->arg_type; | ^~~~~~~~ .../linux-user/syscall.c:5130:27: warning: declaration of 'arg_type' shadow= s a previous local [-Wshadow=3Dlocal] 5130 | const argtype arg_type[] =3D { MK_STRUCT(STRUCT_dm_targ= et_spec) }; | ^~~~~~~~ .../linux-user/syscall.c:4991:20: note: shadowed declaration is here 4991 | const argtype *arg_type =3D ie->arg_type; | ^~~~~~~~ .../linux-user/syscall.c:5170:27: warning: declaration of 'arg_type' shadow= s a previous local [-Wshadow=3Dlocal] 5170 | const argtype arg_type[] =3D { MK_STRUCT(STRUCT_dm_targ= et_versions) }; | ^~~~~~~~ .../linux-user/syscall.c:4991:20: note: shadowed declaration is here 4991 | const argtype *arg_type =3D ie->arg_type; | ^~~~~~~~ Signed-off-by: Laurent Vivier Message-ID: <20230925151029.461358-4-laurent@vivier.eu> Reviewed-by: Thomas Huth Signed-off-by: Markus Armbruster --- linux-user/syscall.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index c6ffadd082..0f1ecc1e0b 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -5050,8 +5050,8 @@ static abi_long do_ioctl_dm(const IOCTLEntry *ie, uin= t8_t *buf_temp, int fd, { void *gspec =3D argptr; void *cur_data =3D host_data; - const argtype arg_type[] =3D { MK_STRUCT(STRUCT_dm_target_spec) }; - int spec_size =3D thunk_type_size(arg_type, 0); + const argtype dm_arg_type[] =3D { MK_STRUCT(STRUCT_dm_target_spec)= }; + int spec_size =3D thunk_type_size(dm_arg_type, 0); int i; =20 for (i =3D 0; i < host_dm->target_count; i++) { @@ -5059,7 +5059,7 @@ static abi_long do_ioctl_dm(const IOCTLEntry *ie, uin= t8_t *buf_temp, int fd, uint32_t next; int slen; =20 - thunk_convert(spec, gspec, arg_type, THUNK_HOST); + thunk_convert(spec, gspec, dm_arg_type, THUNK_HOST); slen =3D strlen((char*)gspec + spec_size) + 1; next =3D spec->next; spec->next =3D sizeof(*spec) + slen; @@ -5099,7 +5099,7 @@ static abi_long do_ioctl_dm(const IOCTLEntry *ie, uin= t8_t *buf_temp, int fd, struct dm_name_list *nl =3D (void*)host_dm + host_dm->data_sta= rt; uint32_t remaining_data =3D guest_data_size; void *cur_data =3D argptr; - const argtype arg_type[] =3D { MK_STRUCT(STRUCT_dm_name_list) = }; + const argtype dm_arg_type[] =3D { MK_STRUCT(STRUCT_dm_name_lis= t) }; int nl_size =3D 12; /* can't use thunk_size due to alignment */ =20 while (1) { @@ -5111,7 +5111,7 @@ static abi_long do_ioctl_dm(const IOCTLEntry *ie, uin= t8_t *buf_temp, int fd, host_dm->flags |=3D DM_BUFFER_FULL_FLAG; break; } - thunk_convert(cur_data, nl, arg_type, THUNK_TARGET); + thunk_convert(cur_data, nl, dm_arg_type, THUNK_TARGET); strcpy(cur_data + nl_size, nl->name); cur_data +=3D nl->next; remaining_data -=3D nl->next; @@ -5127,8 +5127,8 @@ static abi_long do_ioctl_dm(const IOCTLEntry *ie, uin= t8_t *buf_temp, int fd, { struct dm_target_spec *spec =3D (void*)host_dm + host_dm->data= _start; void *cur_data =3D argptr; - const argtype arg_type[] =3D { MK_STRUCT(STRUCT_dm_target_spec= ) }; - int spec_size =3D thunk_type_size(arg_type, 0); + const argtype dm_arg_type[] =3D { MK_STRUCT(STRUCT_dm_target_s= pec) }; + int spec_size =3D thunk_type_size(dm_arg_type, 0); int i; =20 for (i =3D 0; i < host_dm->target_count; i++) { @@ -5139,7 +5139,7 @@ static abi_long do_ioctl_dm(const IOCTLEntry *ie, uin= t8_t *buf_temp, int fd, host_dm->flags |=3D DM_BUFFER_FULL_FLAG; break; } - thunk_convert(cur_data, spec, arg_type, THUNK_TARGET); + thunk_convert(cur_data, spec, dm_arg_type, THUNK_TARGET); strcpy(cur_data + spec_size, (char*)&spec[1]); cur_data =3D argptr + spec->next; spec =3D (void*)host_dm + host_dm->data_start + next; @@ -5167,8 +5167,8 @@ static abi_long do_ioctl_dm(const IOCTLEntry *ie, uin= t8_t *buf_temp, int fd, struct dm_target_versions *vers =3D (void*)host_dm + host_dm->= data_start; uint32_t remaining_data =3D guest_data_size; void *cur_data =3D argptr; - const argtype arg_type[] =3D { MK_STRUCT(STRUCT_dm_target_vers= ions) }; - int vers_size =3D thunk_type_size(arg_type, 0); + const argtype dm_arg_type[] =3D { MK_STRUCT(STRUCT_dm_target_v= ersions) }; + int vers_size =3D thunk_type_size(dm_arg_type, 0); =20 while (1) { uint32_t next =3D vers->next; @@ -5179,7 +5179,7 @@ static abi_long do_ioctl_dm(const IOCTLEntry *ie, uin= t8_t *buf_temp, int fd, host_dm->flags |=3D DM_BUFFER_FULL_FLAG; break; } - thunk_convert(cur_data, vers, arg_type, THUNK_TARGET); + thunk_convert(cur_data, vers, dm_arg_type, THUNK_TARGET); strcpy(cur_data + vers_size, vers->name); cur_data +=3D vers->next; remaining_data -=3D vers->next; --=20 2.41.0 From nobody Sat May 18 15:08:28 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=1696592416; cv=none; d=zohomail.com; s=zohoarc; b=ZByI9ol07AjxqCZnElVheP1BO3LBOZ3lJlLxZR1ZafPZ9y/Pb3ZhNQ2HSJgHiwOs2Yld+LDTSLzdajs5mMK//EuOChs51cL6vudSgj8hWTx2RI8EwrULGvf02153mYdYVDIS/76cN/TuImD5YKlNw9Iyc5QnLJPbFJjoaIN5NDg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696592416; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=7vgbyhnUXIGB+1tDeH0onAn2odq5gPJwvCH/ib+n0Jw=; b=U8uvkjGgieLub/dRc+lIc2DISlsKLMiOZLfpniW6ilUAQ36Rw2DuGUkAy4Y4TgvQe4eqzi5jsryScWMx/cplXJMCdMSss5+67sLStP0CVXvGRDucw9SLUyjF1a5BpZnOffPLDTLI9Bk68ZIRJ3KRa15SevnVFu2gE4lqRVbimVg= 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 1696592416942618.9875443733347; Fri, 6 Oct 2023 04:40:16 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoj9J-000597-MI; Fri, 06 Oct 2023 07:37: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 1qoj8u-00050t-98 for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37:16 -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 1qoj8p-00006y-T7 for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37: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-668-6D27LPJcMWm7iaSWMWWkAA-1; Fri, 06 Oct 2023 07:37:01 -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 F1A7D3C100AC; Fri, 6 Oct 2023 11:37:00 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CA71040C6EA8; Fri, 6 Oct 2023 11:37:00 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id AE5CE21E6894; Fri, 6 Oct 2023 13:36:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696592222; 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=7vgbyhnUXIGB+1tDeH0onAn2odq5gPJwvCH/ib+n0Jw=; b=KSJwtC4VaG1wc0mrUwmF6eEYqURRlqf5Z/Y/1gM8XNr2HWuFrakX0aqHm0Sf3/SXoJUeb4 pGroXnrD4WseQBqMH3Byb+6xYs2phMbaMNVGkOVFuy9wSQFFXZRvsjzTolNOGQvpdJfwBM AZpCtI3RhmDzB/josSP03QJIA1XFmVU= X-MC-Unique: 6D27LPJcMWm7iaSWMWWkAA-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, Laurent Vivier , Thomas Huth Subject: [PULL 31/32] linux-user/syscall.c: clean up local variable shadowing in TARGET_NR_getcpu Date: Fri, 6 Oct 2023 13:36:56 +0200 Message-ID: <20231006113657.3803180-32-armbru@redhat.com> In-Reply-To: <20231006113657.3803180-1-armbru@redhat.com> References: <20231006113657.3803180-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.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: 1696592417711100003 Content-Type: text/plain; charset="utf-8" From: Laurent Vivier Fix following warnings: .../linux-user/syscall.c: In function 'do_syscall1': .../linux-user/syscall.c:11180:22: warning: declaration of 'cpu' shadows a = previous local [-Wshadow=3Dlocal] 11180 | unsigned cpu, node; | ^~~ .../linux-user/syscall.c:8963:15: note: shadowed declaration is here 8963 | CPUState *cpu =3D env_cpu(cpu_env); | ^~~ Signed-off-by: Laurent Vivier Message-ID: <20230925151029.461358-5-laurent@vivier.eu> Reviewed-by: Thomas Huth Signed-off-by: Markus Armbruster --- linux-user/syscall.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 0f1ecc1e0b..97a5e9ddf2 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -11177,14 +11177,14 @@ static abi_long do_syscall1(CPUArchState *cpu_env= , int num, abi_long arg1, } case TARGET_NR_getcpu: { - unsigned cpu, node; - ret =3D get_errno(sys_getcpu(arg1 ? &cpu : NULL, + unsigned cpuid, node; + ret =3D get_errno(sys_getcpu(arg1 ? &cpuid : NULL, arg2 ? &node : NULL, NULL)); if (is_error(ret)) { return ret; } - if (arg1 && put_user_u32(cpu, arg1)) { + if (arg1 && put_user_u32(cpuid, arg1)) { return -TARGET_EFAULT; } if (arg2 && put_user_u32(node, arg2)) { --=20 2.41.0 From nobody Sat May 18 15:08:28 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=1696592533; cv=none; d=zohomail.com; s=zohoarc; b=LgvLG3edUmrzfVCewXxVof6BlESWvgcYP4T+cBIQAX5r3Duk2uf7LBC8AEdhWMEpc7aCQ7HjyloEjn7oFeauKyzHn9nIlQ8sPvHD1aTTZGsCenfGpMUFKPsNGptiCPPxgFK8KNVrEQpmfG/E0YbZTGr0/UEGVqZ4i3DDSMRmwks= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696592533; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=IiuLRIOLTArS9qxuC7vVu92Tiusj+SO0PvCD56qkjVU=; b=GaOMKdpYd4KU4UbCRNgerJNG7IFHW9SrfRS7rcm2uOOuVSY06+obwmY594FMk1jKC/CTp5n0kDp2JDcBJSz6tiz8WNLB8QZxFUwArP99I/HJxB732e+Qr06jo7ZWT6Z4IlSkIinYV5U1gIodONj0hFOYFdv0QUi40U8mrdIXLiE= 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 169659253397748.357555599543616; Fri, 6 Oct 2023 04:42:13 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoj9J-00059A-NV; Fri, 06 Oct 2023 07:37: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 1qoj8w-00051r-Ib for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37:18 -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 1qoj8t-00008T-7x for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37:18 -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-65-P-APc64XNb-m3vwr6sRSfw-1; Fri, 06 Oct 2023 07:37:01 -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 049EB101A59B; Fri, 6 Oct 2023 11:37:01 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D7BED2156711; Fri, 6 Oct 2023 11:37:00 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id B121C21E6895; Fri, 6 Oct 2023 13:36:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696592226; 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=IiuLRIOLTArS9qxuC7vVu92Tiusj+SO0PvCD56qkjVU=; b=DpnDSqhFcn/k2Nb/n+tKPdwFPj0PoCOWOi9SNKVjsATeenLz6j6ID3tX3ASweTMmPv1YCE zqZ3hI3vABNt43JrYJBe78HwjaqG1qP6yBwu7w/HiRAESPkL50aarJaDjXTud1l43D5Oxo AUtPURUYg8nxL2PfVZlD43r3hYTDnpI= X-MC-Unique: P-APc64XNb-m3vwr6sRSfw-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, Laurent Vivier , Thomas Huth Subject: [PULL 32/32] linux-user/syscall.c: clean up local variable shadowing in xattr syscalls Date: Fri, 6 Oct 2023 13:36:57 +0200 Message-ID: <20231006113657.3803180-33-armbru@redhat.com> In-Reply-To: <20231006113657.3803180-1-armbru@redhat.com> References: <20231006113657.3803180-1-armbru@redhat.com> MIME-Version: 1.0 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: 1696592535968100006 Content-Type: text/plain; charset="utf-8" From: Laurent Vivier p is a generic variable in syscall() and can be used by any syscall case, so this patch removes the useless local variable declaration for the following syscalls: TARGET_NR_llistxattr, TARGET_NR_listxattr, TARGET_NR_setxattr, TARGET_NR_lsetxattr, TARGET_NR_getxattr, TARGET_NR_lgetxattr, TARGET_NR_removexattr, TARGET_NR_lremovexattr. Fix following warnings: .../linux-user/syscall.c:12342:15: warning: declaration of 'p' shadows a pr= evious local [-Wshadow=3Dcompatible-local] 12342 | void *p, *b =3D 0; | ^ .../linux-user/syscall.c:8975:11: note: shadowed declaration is here 8975 | void *p; | ^ .../linux-user/syscall.c:12379:19: warning: declaration of 'p' shadows a pr= evious local [-Wshadow=3Dcompatible-local] 12379 | void *p, *n, *v =3D 0; | ^ .../linux-user/syscall.c:8975:11: note: shadowed declaration is here 8975 | void *p; | ^ .../linux-user/syscall.c:12424:19: warning: declaration of 'p' shadows a pr= evious local [-Wshadow=3Dcompatible-local] 12424 | void *p, *n, *v =3D 0; | ^ .../linux-user/syscall.c:8975:11: note: shadowed declaration is here 8975 | void *p; | ^ .../linux-user/syscall.c:12469:19: warning: declaration of 'p' shadows a pr= evious local [-Wshadow=3Dcompatible-local] 12469 | void *p, *n; | ^ .../linux-user/syscall.c:8975:11: note: shadowed declaration is here 8975 | void *p; | ^ Signed-off-by: Laurent Vivier Message-ID: <20230925151029.461358-6-laurent@vivier.eu> Reviewed-by: Thomas Huth Signed-off-by: Markus Armbruster --- linux-user/syscall.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 97a5e9ddf2..d49cd314a2 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -12339,7 +12339,7 @@ static abi_long do_syscall1(CPUArchState *cpu_env, = int num, abi_long arg1, case TARGET_NR_listxattr: case TARGET_NR_llistxattr: { - void *p, *b =3D 0; + void *b =3D 0; if (arg2) { b =3D lock_user(VERIFY_WRITE, arg2, arg3, 0); if (!b) { @@ -12376,7 +12376,7 @@ static abi_long do_syscall1(CPUArchState *cpu_env, = int num, abi_long arg1, case TARGET_NR_setxattr: case TARGET_NR_lsetxattr: { - void *p, *n, *v =3D 0; + void *n, *v =3D 0; if (arg3) { v =3D lock_user(VERIFY_READ, arg3, arg4, 1); if (!v) { @@ -12421,7 +12421,7 @@ static abi_long do_syscall1(CPUArchState *cpu_env, = int num, abi_long arg1, case TARGET_NR_getxattr: case TARGET_NR_lgetxattr: { - void *p, *n, *v =3D 0; + void *n, *v =3D 0; if (arg3) { v =3D lock_user(VERIFY_WRITE, arg3, arg4, 0); if (!v) { @@ -12466,7 +12466,7 @@ static abi_long do_syscall1(CPUArchState *cpu_env, = int num, abi_long arg1, case TARGET_NR_removexattr: case TARGET_NR_lremovexattr: { - void *p, *n; + void *n; p =3D lock_user_string(arg1); n =3D lock_user_string(arg2); if (p && n) { --=20 2.41.0