From patchwork Mon Oct 9 10:02:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 730981 Delivered-To: patch@linaro.org Received: by 2002:ab3:7922:0:b0:23f:8cfb:5ad7 with SMTP id j2csp1289350ltl; Mon, 9 Oct 2023 03:04:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHxJckB1frHEZS+dRM/7u18718bpc7jQxjNl/sxcDsLKfPQ5HSArwmo3n/nrF3xGpYBLZCD X-Received: by 2002:a05:620a:e9a:b0:775:6d45:14a with SMTP id w26-20020a05620a0e9a00b007756d45014amr14880561qkm.4.1696845839721; Mon, 09 Oct 2023 03:03:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696845839; cv=none; d=google.com; s=arc-20160816; b=PYcOC5G8veP+BG0xLE0tLUP1MkWFgVUouehp/172dEylqESwthSwMGqfHwuEKy7guU rd+BEiVPkOEq6kONZUv4tROyh3If6PcSKNmS7bqEgHnG+xKa3MDyy2NnLCcE+CUbzM18 qCZj+IqndSLL+Wn9eo0CNgTO4yWQ0NckKvr2bytpJNxGK1J4FJIINWLkMhhKrwBZIpr1 S/j0fIKM+t3gnFKfRDBKRF/zfaKfuIg3scMbpC9ZFUUHtm3ffgk5NfgGzhIedHKRYhOF zB4f2ppLs4kPTffio+camTNY7wsxcIuwuF1XL5pZfNQF5h96E/6eNYbbRpF68jsK8Ky1 NyJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=wt6aiJAngF+1rHQyivcpsZ85UBVqDOe5WBHF8BS6ZcM=; fh=+UA/OvAzPt1sCt0A7U0kURxgTxGl33GhvbTVlpu8K7o=; b=pYYHCa4O22YuvTO0wi0CyKLGCp5b8cqzVz+QL3gqLYXi3rvt0tnu2160R4hiEEXdjc E5S4qYgYZ3h6ehcACYVQ119LnyPta3j4D8dHmpeKZiLSpS2zi5A2N/y6rCy1yPgcz/ze azS3JCTGSFFQuMewTiIjB/SOyuhhZzC0UJP7DDCLclGG/w6/4BGXVMLhLDPdVxDS8Xqb RylgJNVrpa2gzC+3BdfRg8hYqIO0ofyrnZQTtFZum2dhcbODAAY2WqutQVH/RcBZPe6w wNO3YbpjmuQUfQrGpaOQ/iNDxoZojwISFqQ4I6644reBwq8PGfnYtzMdzqvcn/frsTK7 4IwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="PaZFK/qW"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id i18-20020a05620a405200b007759f9416easi5784272qko.635.2023.10.09.03.03.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Oct 2023 03:03:59 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="PaZFK/qW"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qpn6p-0003CE-Un; Mon, 09 Oct 2023 06:03: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 1qpn6V-000358-DG for qemu-devel@nongnu.org; Mon, 09 Oct 2023 06:03:13 -0400 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qpn6P-00008j-Qf for qemu-devel@nongnu.org; Mon, 09 Oct 2023 06:03:07 -0400 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-40572aeb73cso39562275e9.3 for ; Mon, 09 Oct 2023 03:03:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696845780; x=1697450580; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wt6aiJAngF+1rHQyivcpsZ85UBVqDOe5WBHF8BS6ZcM=; b=PaZFK/qWUOpEWgz3aCM6roj84qUETeZCRrAWDU1Nalz0qMiavJQ/1fH9RCLgY1lvz/ HxnUBE0zNeB1cMa+bSk1YJa9j2oT25GjfiQqQZpbyWk7LARaLkfgVjTjP4vS5n71/XhM 3yGX2/r//zM7tMOL8Vq8PsM4MLEe0xoXk3WtB5OgXfU3Fva/NwEmLD9RhfCeGWnalYqx nRva6SoCPUXSwSKfBv9ZsF47p6+IgDzKCmNcZhU876+zTWRcd+LK1U6NISP1s9HtqdDP +5pXrn7aGXwRkPLMYfoyB4NGp7CAl1M/3HDJ5dpiHjUImCgTOZ3NrIadNBSiwlRBQuLG SZAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696845780; x=1697450580; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wt6aiJAngF+1rHQyivcpsZ85UBVqDOe5WBHF8BS6ZcM=; b=vDGlx5c5MLXD93ZaqyPR5PeBBNXxooOjYOhrieIbsbyvWnN0xWziOL0fIdGFddBNSB S5OXjXCH71ZN3XYLbcd7HbXU071pX/3H8zLt+qDdClw4EwcQ0LMxOnRdnBHisY3oQAK8 2oCmIg7633SoLIUPIYmctshn86/fluKLjvwH/vWb1BKWVrf4zXY52wJaMOnMF9HvcElL 5wUHmv/u8XZBbeu3gT6bX6panjJWZ+rBjNIlPN1+XMrMjV4XzwLHRGGS6gloF3h0xvW0 Y22NV9BSa8Dlia8dVjqDeWc2Gy1a3gxOTyS8rpBcftnKQwrnrL2j+HZaivyNo0vqLG8b lHuQ== X-Gm-Message-State: AOJu0Yx0GUlxurvaY3Yr7cP/sSN7Lg6IDxzi6pvsz+zc+4k+bIdwD7Y0 w2AdF/YFmnfGNGBCoItbxgUBb0Z3vOPMw6zM+vI= X-Received: by 2002:a5d:4d12:0:b0:31f:f9a9:a742 with SMTP id z18-20020a5d4d12000000b0031ff9a9a742mr12146379wrt.23.1696845780208; Mon, 09 Oct 2023 03:03:00 -0700 (PDT) Received: from m1x-phil.lan (thr44-h01-176-170-217-185.dsl.sta.abo.bbox.fr. [176.170.217.185]) by smtp.gmail.com with ESMTPSA id v6-20020adff686000000b0031980294e9fsm9054813wrp.116.2023.10.09.03.02.58 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 09 Oct 2023 03:02:59 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Alberto Garcia , Hao Wu , Kevin Wolf , Thomas Huth , Laurent Vivier , Paolo Bonzini , qemu-block@nongnu.org, John Snow , Stefan Hajnoczi , Fam Zheng , Tyrone Ting , Markus Armbruster , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PATCH 01/10] system/qtest: Clean up global variable shadowing in qtest_server_init() Date: Mon, 9 Oct 2023 12:02:42 +0200 Message-ID: <20231009100251.56019-2-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231009100251.56019-1-philmd@linaro.org> References: <20231009100251.56019-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=philmd@linaro.org; helo=mail-wm1-x336.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Rename the variable to fix: softmmu/qtest.c:869:13: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] Object *qtest; ^ softmmu/qtest.c:53:15: note: previous declaration is here static QTest *qtest; ^ Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth --- softmmu/qtest.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/softmmu/qtest.c b/softmmu/qtest.c index 35b643a274..7964f0b248 100644 --- a/softmmu/qtest.c +++ b/softmmu/qtest.c @@ -866,7 +866,7 @@ void qtest_server_init(const char *qtest_chrdev, const char *qtest_log, Error ** { ERRP_GUARD(); Chardev *chr; - Object *qtest; + Object *qobj; chr = qemu_chr_new("qtest", qtest_chrdev, NULL); if (chr == NULL) { @@ -875,18 +875,18 @@ void qtest_server_init(const char *qtest_chrdev, const char *qtest_log, Error ** return; } - qtest = object_new(TYPE_QTEST); - object_property_set_str(qtest, "chardev", chr->label, &error_abort); + qobj = object_new(TYPE_QTEST); + object_property_set_str(qobj, "chardev", chr->label, &error_abort); if (qtest_log) { - object_property_set_str(qtest, "log", qtest_log, &error_abort); + object_property_set_str(qobj, "log", qtest_log, &error_abort); } - object_property_add_child(qdev_get_machine(), "qtest", qtest); - user_creatable_complete(USER_CREATABLE(qtest), errp); + object_property_add_child(qdev_get_machine(), "qtest", qobj); + user_creatable_complete(USER_CREATABLE(qobj), errp); if (*errp) { - object_unparent(qtest); + object_unparent(qobj); } object_unref(OBJECT(chr)); - object_unref(qtest); + object_unref(qobj); } static bool qtest_server_start(QTest *q, Error **errp) From patchwork Mon Oct 9 10:02:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 730986 Delivered-To: patch@linaro.org Received: by 2002:ab3:7922:0:b0:23f:8cfb:5ad7 with SMTP id j2csp1289820ltl; Mon, 9 Oct 2023 03:05:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHbgKvwgqDEEiYGTjkJMAA8357Iy5uk4GD9pNYu+J1Eqo7dBHcJNmYplU4kXGH5GaYRCPjB X-Received: by 2002:a05:622a:105:b0:412:4847:20af with SMTP id u5-20020a05622a010500b00412484720afmr20136819qtw.23.1696845900133; Mon, 09 Oct 2023 03:05:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696845900; cv=none; d=google.com; s=arc-20160816; b=Pd7UGCrCyXPm5hKXkY5LymFZzvpxPSXcEyxJl9rd7JiA3so1x60aaq96ueadoIsGjj s+Te8nm2G6ff9CL6ZuOuKrxDHOF+yd4OvtPkVOHB6AJwRal86vhOsKcxsS8QcIcJnRm6 PQodXNCENM+TbU/5FCnC62ULDmWMWxwOqQvh/7OPyLKhPk8mQUGbRMuAWfkainuB5BlF t/ou63328hkNo6H1AMZE9d76+vfP1tEtGj5k8E2AUnEEbsT5mQ+7tGiihrE8YrQspBx8 5olTwo4YKkWih/SQdyxurY9fbV7RkFs4W5wA3K/TEfxenNzI9tn5MhUkzVZepXmp0KaN krvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=zRojbwnUlDvXIlWaYRNObAm149GLlZOkoyr1o1S54zA=; fh=+UA/OvAzPt1sCt0A7U0kURxgTxGl33GhvbTVlpu8K7o=; b=DejgncOUptEt8Zx3m5wX6eKB8XBNv/yXqn96a3SLhIxJhRG8IK84bzhQtbFaB5DOcJ iICe0Kxv3/qmZ52/dLKNKqhV9zAkrvJdK1x8DONqrwmuVn8hHwUiKvpAIJZqznJGiib7 jukFKVzzipWYOkO/rNfO1zwRmS2Fb5fFw6aL4CKaRygFpKDMgXlJDuX5J3j4WBvkRZ4r NvzgZq/DpXadtPah/Dv0LDH1b5/gbNTlfTWIYVJu1GKmdrJW1UiDQGkwoCyX6hgzmfW5 FblBjnILucCJb9QS1xvLSb7XmRfy/hbRZ2rHfEQD9y0kYVAxNm3qKHc6NKIqWZxWuHzy x70A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CB8yS5HL; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id u10-20020ac858ca000000b0041809775e0asi6001151qta.92.2023.10.09.03.04.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Oct 2023 03:05:00 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CB8yS5HL; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qpn71-0003Qx-UV; Mon, 09 Oct 2023 06:03: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 1qpn6l-0003Bi-7K for qemu-devel@nongnu.org; Mon, 09 Oct 2023 06:03:30 -0400 Received: from mail-lj1-x235.google.com ([2a00:1450:4864:20::235]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qpn6V-00009P-BP for qemu-devel@nongnu.org; Mon, 09 Oct 2023 06:03:24 -0400 Received: by mail-lj1-x235.google.com with SMTP id 38308e7fff4ca-2bffa8578feso51914931fa.2 for ; Mon, 09 Oct 2023 03:03:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696845786; x=1697450586; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=zRojbwnUlDvXIlWaYRNObAm149GLlZOkoyr1o1S54zA=; b=CB8yS5HL9TFgucBwsoEMCMJZXm9I3uQ/xQcGPzTAY76ip6G0ZFxOmICMH0crMa16XV IncQ6CQOND1qNV7R5EuMX31WB37oeOXVkkRnsS6wpFa9igKAlmuMx+DPlF6VkDgOha95 GbK8YIdg5J2WPqIRGZFlDNknQGhq4YGwEt8eG1p4RC5MRihG1OkLQzAumw8KwwYVHCvR Clpj6gK/cWvyg4wumhjw8IxPbJy1w1DVSMxSTR/tykh+7yxGy2ZdnLY3EV5bx6k1UU3t kyHxCiNMXDkhCMoYxrk49fNeMTn+Tn15YUhMaqfssMnNDAJiW0CUG56pN30fOtctORyV fbjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696845786; x=1697450586; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zRojbwnUlDvXIlWaYRNObAm149GLlZOkoyr1o1S54zA=; b=DocqqOULvAWDt2nI9NLDmw5rOocvTMzV5U5iDRT3geMxCsZ89Nmm7ItfzSbZ4CshyQ i9DjyJ0QSpEkeR1uK5qwh6XTz6o43lbxgUqDnioKC3RnUg+IYGWrA0cQIePKuRcosib+ ciNgW+TpsCX2O8oPoyWlOyRbpu5LeiBCz6AzAj9/0Ca2L8EaZ5VlQah/bpwZ4Sc+Q0P5 yXMRACQHyG47kdOL3Qjl1wb5xM72ABUd8XWJ0XfJjH3gGI5/G8L2FsFWIQN8vcqJH2yl Q42swun2yPXjgbt4oLkBZunF6NGRZl1XLd1TEBYEwGlNbeuqz8Nd8cpx2TFuFAryEEoX DAjw== X-Gm-Message-State: AOJu0YyKAh7v9YOipYGb/588GatOIlpj/qOOiH1BUmvI2+5nL199HL3i pcIX2UbmFCumB7qJ6/G9VaAiDbUfcDTyH/di9o4= X-Received: by 2002:a05:6512:3447:b0:500:7efe:313c with SMTP id j7-20020a056512344700b005007efe313cmr11157068lfr.24.1696845786199; Mon, 09 Oct 2023 03:03:06 -0700 (PDT) Received: from m1x-phil.lan (thr44-h01-176-170-217-185.dsl.sta.abo.bbox.fr. [176.170.217.185]) by smtp.gmail.com with ESMTPSA id e17-20020a05600c219100b0040646a708dasm10696156wme.15.2023.10.09.03.03.04 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 09 Oct 2023 03:03:05 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Alberto Garcia , Hao Wu , Kevin Wolf , Thomas Huth , Laurent Vivier , Paolo Bonzini , qemu-block@nongnu.org, John Snow , Stefan Hajnoczi , Fam Zheng , Tyrone Ting , Markus Armbruster , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PATCH 02/10] tests/throttle: Clean up global variable shadowing Date: Mon, 9 Oct 2023 12:02:43 +0200 Message-ID: <20231009100251.56019-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231009100251.56019-1-philmd@linaro.org> References: <20231009100251.56019-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::235; envelope-from=philmd@linaro.org; helo=mail-lj1-x235.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Follow all other tests pattern from this file, use the global 'cfg' variable to fix: tests/unit/test-throttle.c:621:20: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] ThrottleConfig cfg; ^ tests/unit/test-throttle.c:28:23: note: previous declaration is here static ThrottleConfig cfg; ^ Signed-off-by: Philippe Mathieu-Daudé Acked-by: Alberto Garcia --- tests/unit/test-throttle.c | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/unit/test-throttle.c b/tests/unit/test-throttle.c index ac35d65d19..2146cfacd3 100644 --- a/tests/unit/test-throttle.c +++ b/tests/unit/test-throttle.c @@ -618,7 +618,6 @@ static bool do_test_accounting(bool is_ops, /* are we testing bps or ops */ { THROTTLE_OPS_TOTAL, THROTTLE_OPS_READ, THROTTLE_OPS_WRITE, } }; - ThrottleConfig cfg; BucketType index; int i; From patchwork Mon Oct 9 10:02:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 730989 Delivered-To: patch@linaro.org Received: by 2002:ab3:7922:0:b0:23f:8cfb:5ad7 with SMTP id j2csp1290805ltl; Mon, 9 Oct 2023 03:06:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFFXGRYDilmCNgsZV9iUTrMlr37Mt71BEoV1kpQ1MW2yA9WFvUybDJROquWwKU68l7BSefL X-Received: by 2002:a0c:fed1:0:b0:64f:4240:8e1b with SMTP id z17-20020a0cfed1000000b0064f42408e1bmr15698162qvs.44.1696846010377; Mon, 09 Oct 2023 03:06:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696846010; cv=none; d=google.com; s=arc-20160816; b=OS1E1IsSbEePN7qaN3/icU5X7jFO39s0UDhpr/1NNfE3UFOOTJGgdswvY2uQj6D0vH AD4HNPun1NcAipiiPJFDzfiWuJQrXuy0NVwJrWCUsRXuGL0DiI+OcBOlLWM1nCLJP8yu km9OAatWmCuXo9WrTMQy5sYojoclYFp55kMqEop3vy4MSEAgqylahpI16ugeIs8IoaIH izeE3G3NNeE9SqUlt3zMwUGLQ2o9tGZgNTYDfkjLtkXgJrTLd6xq0bewp0xSNCVdDkZp 7JfLzkXRdlWQps7bIwAVEyspxAV/pnYtGVEUOdHtIxYo+FJT34FQtUCKuBPNJxwEMwIt Nvtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=CcautlB5vSVFo4vMCX8wZDEeLw5WS31TyE81+hqdwZU=; fh=+UA/OvAzPt1sCt0A7U0kURxgTxGl33GhvbTVlpu8K7o=; b=lKJXS0CEemP+YfzoVjuqaHZKlXRv8KkAw8OPV9mljV5gZG1fSH0I+3uW8Fr8aRt3v1 k6gF3ghWxF5baht7N77Y2KnGZsj56ftuONzMEzDx5BjMdrVDM83iMJB6gWcbKc6Ub3XQ jFCFN9qq46QwQgl00/u8GwJZ5Z3yAUyLUs1/nrh+TiVsUY3ZtCm0l5Z/glKy8yFNTuoP bSC7Z9DvqUfPJhX/QV0DavO84mdD4axmjQZC09QqJmK0489MxKaV3+G4LKN6wiYgi4zD BiojTVEg3Lk/ZUVCl+GgRUft6lRhf7BNjx9S+IZyFJJSFoCQjY0ao5JNEiPvY/Sdkgtp qSgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LqiENubT; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id b26-20020a0cb3da000000b0065b05790428si5915869qvf.390.2023.10.09.03.06.50 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Oct 2023 03:06:50 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LqiENubT; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qpn73-0003SO-9L; Mon, 09 Oct 2023 06:03:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qpn6h-0003A7-Mo for qemu-devel@nongnu.org; Mon, 09 Oct 2023 06:03:25 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qpn6Y-0000AO-SL for qemu-devel@nongnu.org; Mon, 09 Oct 2023 06:03:18 -0400 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-40566f89f6eso43225225e9.3 for ; Mon, 09 Oct 2023 03:03:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696845792; x=1697450592; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=CcautlB5vSVFo4vMCX8wZDEeLw5WS31TyE81+hqdwZU=; b=LqiENubTzJbwxZmhmbciLJv3+8ZiwzmAevxrBHFuBtw9bQtm4bV8KQdaLtQpTaZwvP cI3kBPm6NRqHGc7t13QEv7WrZDYcsXDOYnvmW77HVHwVi8gpxwyy2T3i5rUcf9zvM8Za 9dGrpeA0enPcuDbMi+Yh44/bmyrQAuMvKnNDKJlapdWNatvVQjpoF/G1Y6Z6Zw9Q6gpz cgi7jK15DWKpeOQOA053Uv3FSMzFhd7q/UqKJASSMJvoPKMV3jX7dVhGX5mr5Hleq1qd VzNLpGeU8tJqMCvDyXw6WMKB6nZ9SBbhuYlxURI0dBoIa4zvhrg+NQNr4vlOMrUnqqi9 MbzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696845792; x=1697450592; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CcautlB5vSVFo4vMCX8wZDEeLw5WS31TyE81+hqdwZU=; b=QfDpylCBDGsA8/dc7eUzGVSrp6d8/iLnd46DTC5a7jnC92x2KP5Pf4i6/E/yuFHGt4 XxECR/3Ag44JFS5s7d1Z0m/cp2UUPaleZQZx52lDuzyH4eu11aYUeBweUwlvbZ5xLIM8 T10szT4Ojjhoo7vYE6Czkp8UIJBfH+fyK/H8GeF1W3cfsv/+M9R0+2UZ3HdONQd63ja2 nb5FDY6kbteiIGrzdvdtrTzxwJQ9MLzWbQvDs3qvJZmD+f8lWcZ3An9x0a9nfy8u4tzF eI1KyS4yvaa0e5D1bjdlhIvvMp5c2EWcivOUmxWLTf1TLnIcnd6YyMvqJCN1ROG3HdPH LDxQ== X-Gm-Message-State: AOJu0Yy8inhV4S05TZK8l52daR2Z2cGOuzp2roFZk+b3PeuAsDLAZdEH Nm9UIfjLRXTcpv54MHGURxJsEdR5EtOEOJ4AjnM= X-Received: by 2002:a05:600c:2191:b0:405:36a0:108f with SMTP id e17-20020a05600c219100b0040536a0108fmr14034470wme.41.1696845791966; Mon, 09 Oct 2023 03:03:11 -0700 (PDT) Received: from m1x-phil.lan (thr44-h01-176-170-217-185.dsl.sta.abo.bbox.fr. [176.170.217.185]) by smtp.gmail.com with ESMTPSA id n16-20020a05600c3b9000b0040684abb623sm13067525wms.24.2023.10.09.03.03.10 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 09 Oct 2023 03:03:11 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Alberto Garcia , Hao Wu , Kevin Wolf , Thomas Huth , Laurent Vivier , Paolo Bonzini , qemu-block@nongnu.org, John Snow , Stefan Hajnoczi , Fam Zheng , Tyrone Ting , Markus Armbruster , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PATCH 03/10] tests/virtio-scsi: Clean up global variable shadowing Date: Mon, 9 Oct 2023 12:02:44 +0200 Message-ID: <20231009100251.56019-4-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231009100251.56019-1-philmd@linaro.org> References: <20231009100251.56019-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=philmd@linaro.org; helo=mail-wm1-x329.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Rename the (unused) 'allow' argument, following the pattern used by the other tests in this file. This fixes: tests/qtest/virtio-scsi-test.c:159:61: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] static void hotplug(void *obj, void *data, QGuestAllocator *alloc) ^ tests/qtest/virtio-scsi-test.c:37:25: note: previous declaration is here static QGuestAllocator *alloc; ^ Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth Reviewed-By: Emmanouil Pitsidianakis --- tests/qtest/virtio-scsi-test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qtest/virtio-scsi-test.c b/tests/qtest/virtio-scsi-test.c index ceaa7f2415..db10d572d0 100644 --- a/tests/qtest/virtio-scsi-test.c +++ b/tests/qtest/virtio-scsi-test.c @@ -156,7 +156,7 @@ static QVirtioSCSIQueues *qvirtio_scsi_init(QVirtioDevice *dev) return vs; } -static void hotplug(void *obj, void *data, QGuestAllocator *alloc) +static void hotplug(void *obj, void *data, QGuestAllocator *t_alloc) { QTestState *qts = global_qtest; From patchwork Mon Oct 9 10:02:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 730991 Delivered-To: patch@linaro.org Received: by 2002:ab3:7922:0:b0:23f:8cfb:5ad7 with SMTP id j2csp1291086ltl; Mon, 9 Oct 2023 03:07:25 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFrXSfQQJUWKIEtR0hBtsWQClfnIcom0Mz/GVxBDp2Vp6Njv5HqhyHxCYQV0r3+QMK4QChq X-Received: by 2002:ac8:5a95:0:b0:417:b026:793f with SMTP id c21-20020ac85a95000000b00417b026793fmr18882164qtc.29.1696846045187; Mon, 09 Oct 2023 03:07:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696846045; cv=none; d=google.com; s=arc-20160816; b=q1NohQJpJbP8zOmjuGhPNw6TYQj9MDoaIK5yaKKMQubIJMK4vxE3UxGHPZ5+0EbENg SvztP8CuPL9RUbF/vgO2cZHqTUdz02QZVhdg29SUP9W6Ecoeypp4rVQQYWtLJYV9fWbk xrPGokDWCv8HwgLnaq63c/dLZSYyZPl6BCP+mMMbBsCfgm1EkoPe9AxvSeXVX6H8lTGc j1RdHxytnmxUvSe2Hv2ERY55HipqYRKBi3b8nz80uN4aXdm1qi0g1PZnddlWUuJdEyQI EXkIoSzp+frliZbfUUMQCEeK0aTv6OAvbGhw34W1yJuyUIDmW/55GQ7U3aoc8DY25+6p 6uXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=41oTD6R/rEUywh5fXwmkk1fZnIoCcZZdSBr5PNChPlg=; fh=+UA/OvAzPt1sCt0A7U0kURxgTxGl33GhvbTVlpu8K7o=; b=sir3m5zE0Hbfhgwcbvxy8v0OiTCt9OIsvbRrNy9VVJaG3bQ8pOCRI0lU8/ZtfLO9vX c2O4asR5vch2En8TqSaG9E2HWZ+e9tTKsxAbyXHvIf7SQjxcHK8rMt06z/UrSyIwiNaK GZdVBlAMgdJNW0oHD1yKETQztPNjtGB85eIkSLyc/QHdJKmH9GZZiLCp/69LeCxLJbGA JWJ7q4/jC6Z+Oib+T9geXA6h9NRPLxPeV+lqF+0p9YK0ggNHM+ypiGR1VnPNhX8Y063F NLDZSGtk2aUqvY1Gakk91yC8OKHRgaujIkq+C46/1jF2zkNw4TJumr9r3SdnNHeP2owS kNPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lTmCt5zV; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id i17-20020ac85e51000000b004181f36343fsi5931018qtx.775.2023.10.09.03.07.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Oct 2023 03:07:25 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lTmCt5zV; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qpn75-0003Xz-4l; Mon, 09 Oct 2023 06:03:47 -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 1qpn6l-0003CK-83 for qemu-devel@nongnu.org; Mon, 09 Oct 2023 06:03:30 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qpn6g-0000BJ-I9 for qemu-devel@nongnu.org; Mon, 09 Oct 2023 06:03:25 -0400 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-40572aeb673so41851495e9.0 for ; Mon, 09 Oct 2023 03:03:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696845798; x=1697450598; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=41oTD6R/rEUywh5fXwmkk1fZnIoCcZZdSBr5PNChPlg=; b=lTmCt5zVWvuSfREsyX5+5q3QyhFC/3EU8hv4Kt0Bj1EwsxjnJihBXjpgWxu8ZDnrrj 54lNAarh1aLyYBjb/xKhz07yv5v67ifaXr9rI4ngSw6ipUIlTGr7fcVSLTLJuuUmYqDH IYbZfO4eb8XY/g1EztLSx8gR4lm3WvFa4GVpYgxqZS/WiHfKYwWo1sycRI7zRtIYwPuY /74e7er2tSevzuPFG3hgUEVIbxOd6jhz1qE4GfOBA0kJUCwTPCk/V9kRPvFqi+Mdh1PX aJZlGkA9VxrxgXz7MxcC4sBZ/vop6F1G4lXa6WnxDOMOfzfOzJwz+CTw3fj2xRDbdBVi Vxwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696845798; x=1697450598; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=41oTD6R/rEUywh5fXwmkk1fZnIoCcZZdSBr5PNChPlg=; b=CkNUYQYgR+pFQNK3Ek7WvRoiggGiC8Oc+0LF1bj2o6YB3Nxh8azF90hFli24Fzv75k WJUrzKuvKW21jXF4uyv5Z0UDjGDKzj0g2hUOR1D9m02GXaVsn0LOjQCx+uFI38SPoUYJ TKTbpAP46umdXjngpFgsi1pYBmaAGCCxLIma95ZoOSYBmh5AolGJbOvVOz58mxZs/8PV HAn4qxYP7W8oSLz3SUCZUC11N16Ru17u8tUn38swCmpbHxK1ngRQUk8eAYwNrqmEjcLt obuLB8KcZgCpHyNttwdtBUU4pQbmWbI34a7BZ5dO3AjvKe9eZB1MOL41ouDZPgoD4LzX RBLg== X-Gm-Message-State: AOJu0YzrH3wsxYH/fIxoIJ7XxsPdMuIRxBhrgbw9jPZjoPFZLJwGqX+s bsTGMecvkJC8iMc/GR6N0Ys4+/NQKOXw0OqUNe8= X-Received: by 2002:a5d:6a4c:0:b0:31f:8a6d:e527 with SMTP id t12-20020a5d6a4c000000b0031f8a6de527mr13848722wrw.45.1696845797855; Mon, 09 Oct 2023 03:03:17 -0700 (PDT) Received: from m1x-phil.lan (thr44-h01-176-170-217-185.dsl.sta.abo.bbox.fr. [176.170.217.185]) by smtp.gmail.com with ESMTPSA id f15-20020a5d50cf000000b00323330edbc7sm9152973wrt.20.2023.10.09.03.03.16 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 09 Oct 2023 03:03:17 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Alberto Garcia , Hao Wu , Kevin Wolf , Thomas Huth , Laurent Vivier , Paolo Bonzini , qemu-block@nongnu.org, John Snow , Stefan Hajnoczi , Fam Zheng , Tyrone Ting , Markus Armbruster , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PATCH 04/10] tests/cdrom-test: Clean up global variable shadowing in prepare_image() Date: Mon, 9 Oct 2023 12:02:45 +0200 Message-ID: <20231009100251.56019-5-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231009100251.56019-1-philmd@linaro.org> References: <20231009100251.56019-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=philmd@linaro.org; helo=mail-wm1-x32c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Rename the variable to fix: tests/qtest/cdrom-test.c:40:50: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] static int prepare_image(const char *arch, char *isoimage) ^ tests/qtest/cdrom-test.c:18:13: note: previous declaration is here static char isoimage[] = "cdrom-boot-iso-XXXXXX"; ^ Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: John Snow --- tests/qtest/cdrom-test.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/qtest/cdrom-test.c b/tests/qtest/cdrom-test.c index f2a8d91929..0945383789 100644 --- a/tests/qtest/cdrom-test.c +++ b/tests/qtest/cdrom-test.c @@ -37,17 +37,17 @@ static int exec_xorrisofs(const char **args) return exit_status; } -static int prepare_image(const char *arch, char *isoimage) +static int prepare_image(const char *arch, char *isoimagepath) { char srcdir[] = "cdrom-test-dir-XXXXXX"; char *codefile = NULL; int ifh, ret = -1; const char *args[] = { "xorrisofs", "-quiet", "-l", "-no-emul-boot", - "-b", NULL, "-o", isoimage, srcdir, NULL + "-b", NULL, "-o", isoimagepath, srcdir, NULL }; - ifh = mkstemp(isoimage); + ifh = mkstemp(isoimagepath); if (ifh < 0) { perror("Error creating temporary iso image file"); return -1; From patchwork Mon Oct 9 10:02:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 730988 Delivered-To: patch@linaro.org Received: by 2002:ab3:7922:0:b0:23f:8cfb:5ad7 with SMTP id j2csp1290418ltl; Mon, 9 Oct 2023 03:06:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEoxx+PlgPudWwHDcbnU34nyUmPzia2uBZwTRQf/UIUhR8mabZ2F4ltdk6dWm7Zxu6RuJyi X-Received: by 2002:a05:620a:4d:b0:775:a91c:80c2 with SMTP id t13-20020a05620a004d00b00775a91c80c2mr11838025qkt.73.1696845968949; Mon, 09 Oct 2023 03:06:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696845968; cv=none; d=google.com; s=arc-20160816; b=jwUdwwAgBKyGH3/7mCRrZp/Bm6xI/P9pUljtZ1sSGjxNecXbIy6DF8hnsFrfg5xdsH HkFWDzA0Y50Hvnnp16+J+ptOcEgg+F6T+dla4EW7QYkJxA6R0HY0HgGDaEd4dsJEMfrI i72ihTAWRUzYnq4HGthBfeVop7pAL3vvP1No+2MqOpPG1r+ZVRfl5kKoSeIp9DKf2jQg da8pTF2HT6it869+h3fgk5v/6RNTKQZ86X4PMPvPSf9DLQ1vIQBGQnUz42QQI8o8NPGv GnOoZg1RMZQfagkvGIci3YnIBBNhIqR1snlUWWNfrejx4MG6n3FlzyJinHyGDnwH9AYf wkZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=tV1dKtatvnpslv9IY1Ow2PCBM/jxT9Mvzt/XqDZ+aVE=; fh=+UA/OvAzPt1sCt0A7U0kURxgTxGl33GhvbTVlpu8K7o=; b=0IKoPWGrqMdVkRLNsZvwLqmmrf2NKb27EudscAcGjjg0szjeQWiFERzobJFLnXOAoU fF3QY3yoBkeTyMYxpHynF7KPwMUe+IoFvV2gY4pYPYspCPnT8hrKqpD6EFR1XTQwV9se JPc2v+4B+zgNHyOUIfJY2sY/DjheI4K48z6osLondNyIAb0TrsHdeO8vWizSNxSedMyX fDwZDtTNXVJ3c0ZnX3QGtDRjs6uobVM/6JEfJatrxpo48SyZFsSQbeP1WJBqE5wj91BF 38Islp8An7M8gaFaKeT2QV51Dk2P/BM+H3Cq0V7qWiJVlZRI0jLi6gLSY6Rrg6PaMLgL ObFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BizLTxfj; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id u6-20020a05620a430600b00770f73d1d6fsi5854408qko.222.2023.10.09.03.06.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Oct 2023 03:06:08 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BizLTxfj; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qpn72-0003T7-QE; Mon, 09 Oct 2023 06:03:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qpn6n-0003Cf-Al for qemu-devel@nongnu.org; Mon, 09 Oct 2023 06:03:31 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qpn6j-0000Cj-V0 for qemu-devel@nongnu.org; Mon, 09 Oct 2023 06:03:28 -0400 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-3231d67aff2so4340803f8f.0 for ; Mon, 09 Oct 2023 03:03:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696845803; x=1697450603; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=tV1dKtatvnpslv9IY1Ow2PCBM/jxT9Mvzt/XqDZ+aVE=; b=BizLTxfjQaUfC3b6v9gx+lRxs+TNsM9dcislbcXj4BkRrPlwRnZ/NXZStflqpgjef3 3LR1eFHdUGzIRDpbETPW1SjyFNZbRMYdj287jbVjN+NZf6tD+obu0sYAjRNqCBOyASAo uzq61kv5kcWmJdJC567JvvV3QuS7kcocaPAvWRNYF+oKr8uqYCJUrS7+Ar0K2i/SWoYi Hn+v3mZpzjAvBL6mx9dIJK/RZN0hxhxZqX28sCL6cL9ku72PSxRhYS5WnrjkG6qpsHYi jF9wYhdSqdrw5VGkc5rLnFHD1LsSw5F9fXfsqAQUgrL7lpFPve2rkW/hpnSyfp7II048 bBYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696845803; x=1697450603; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tV1dKtatvnpslv9IY1Ow2PCBM/jxT9Mvzt/XqDZ+aVE=; b=g2EnoVUqID7AVY30t3sNMJxWZYJZj+BpW48INoG6xC/OWnODJuBdYN6iDaaNq9bImw i9puxDdj70IvocPyL0sotNQ6f6LyJhhoL0CpJ/OgOpH6/PHGnVkbawa/w8fRSdGszq5q O6Sbn9LNRppOOdbZ3VTW1YM2xM3+ZX5R/5nED8/jhHV2rZzbI0Ah/kxPu7QIdIoqRvm2 9znrYpEpbhZ7/V4g06k6PZfezlbq1YFawnSo8Sg5S14sbKQE/Cbv2dseNohyGGLP8lGx qvXRU0k+jBZA2YOM2HCcPGGIG6+gGzZCV605vN1pygDYQSa0Ovg1TTgNfQbRWkq1o3TR RDzA== X-Gm-Message-State: AOJu0YwIpD74uMqZ5s5j8etVzqaM9+/W1tBDSbVpcpm4G9c1m4kLBPjB dC5kDfWxJ4BrcavWmRUmEY+QhPqOHUEyQaRSTlQ= X-Received: by 2002:adf:dd8f:0:b0:313:f45f:74a1 with SMTP id x15-20020adfdd8f000000b00313f45f74a1mr13833134wrl.51.1696845803597; Mon, 09 Oct 2023 03:03:23 -0700 (PDT) Received: from m1x-phil.lan (thr44-h01-176-170-217-185.dsl.sta.abo.bbox.fr. [176.170.217.185]) by smtp.gmail.com with ESMTPSA id l1-20020a5d4bc1000000b00323287186b2sm9144677wrt.29.2023.10.09.03.03.22 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 09 Oct 2023 03:03:23 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Alberto Garcia , Hao Wu , Kevin Wolf , Thomas Huth , Laurent Vivier , Paolo Bonzini , qemu-block@nongnu.org, John Snow , Stefan Hajnoczi , Fam Zheng , Tyrone Ting , Markus Armbruster , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PATCH 05/10] tests/hd-geo-test: Clean up global variable shadowing Date: Mon, 9 Oct 2023 12:02:46 +0200 Message-ID: <20231009100251.56019-6-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231009100251.56019-1-philmd@linaro.org> References: <20231009100251.56019-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=philmd@linaro.org; helo=mail-wr1-x436.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Rename the variable to fix: tests/qtest/hd-geo-test.c:610:11: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] char *img_file_name; ^ tests/qtest/hd-geo-test.c:80:14: note: previous declaration is here static char *img_file_name[backend_last]; ^ Signed-off-by: Philippe Mathieu-Daudé --- tests/qtest/hd-geo-test.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/qtest/hd-geo-test.c b/tests/qtest/hd-geo-test.c index d08bffad91..e5e28c412d 100644 --- a/tests/qtest/hd-geo-test.c +++ b/tests/qtest/hd-geo-test.c @@ -78,6 +78,7 @@ static const CHST hd_chst[backend_last][mbr_last] = { }; static char *img_file_name[backend_last]; +static char *qcow2_imgpath; static const CHST *cur_ide[4]; @@ -607,18 +608,17 @@ static TestArgs *create_args(void) static void add_drive_with_mbr(TestArgs *args, MBRpartitions mbr, uint64_t sectors) { - char *img_file_name; char part[300]; int ret; g_assert(args->n_drives < MAX_DRIVES); - img_file_name = create_qcow2_with_mbr(mbr, sectors); + qcow2_imgpath = create_qcow2_with_mbr(mbr, sectors); - args->drives[args->n_drives] = img_file_name; + args->drives[args->n_drives] = qcow2_imgpath; ret = snprintf(part, sizeof(part), "-drive file=%s,if=none,format=qcow2,id=disk%d", - img_file_name, args->n_drives); + qcow2_imgpath, args->n_drives); g_assert((0 < ret) && (ret <= sizeof(part))); args->argc = append_arg(args->argc, args->argv, ARGV_SIZE, g_strdup(part)); args->n_drives++; @@ -1139,6 +1139,10 @@ test_add_done: g_free(img_file_name[i]); } } + if (qcow2_imgpath) { + unlink(qcow2_imgpath); + g_free(qcow2_imgpath); + } return ret; } From patchwork Mon Oct 9 10:02:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 730984 Delivered-To: patch@linaro.org Received: by 2002:ab3:7922:0:b0:23f:8cfb:5ad7 with SMTP id j2csp1289775ltl; Mon, 9 Oct 2023 03:04:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGqLxefMD/hPY3TOScbXZ5vqGpY2imk59Dpzk1S6XUwPXG9lZlwQO1HcLVaYv0EO2LZE4Vf X-Received: by 2002:a05:622a:1352:b0:414:b35a:c58c with SMTP id w18-20020a05622a135200b00414b35ac58cmr18265195qtk.9.1696845894817; Mon, 09 Oct 2023 03:04:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696845894; cv=none; d=google.com; s=arc-20160816; b=OihKCr/HsNVPLjiKr1cezs3GEJYrmLw0FZnIvPEG+gDLmusUMizNBPCrqQRu6a6zPv c2p8xlxvSsOqVLl9dHtNR8t0Qf3gOPpS/1r4enBpGTDic2BJly8fU0v9GvhZW5qml3UI rpYYEuhU1VkxqqVk26VSUdALV5bahn9juvE2FFRHyZHz2+qRcH4GuDetyfWfWvn05pj8 nTWge6W01od9VB0Icsa73Egep8NPAou/I1WHZbjP2XuXaT0z04p6dedksfB5rMMRep8c x4YIJGw2ja4U/WhkICjhVXe0DR1AsWlGvQCn72azHW9IbzSpj3j8JHevOdJxDCx7giVZ JtAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=vQJEL8vkJwny7eCI7iH0HAlqhSa/NiYKDVoeaT20KQc=; fh=+UA/OvAzPt1sCt0A7U0kURxgTxGl33GhvbTVlpu8K7o=; b=BKKs10ns/6nsm18MTViV0jX6aCpSVoahvm0K15g0CuJ12kcjUOPrAEuV6mr2HZnwpE lGBRXCy90L/qOnrpdf0e3aCHert+kK0HZUMLfKbf1wCzPDvKBzFcDgLxY2wMYIirig3W zrCv/KQkkIlc3p0QyXn1JtXi2zogABmNYDnuGbiKabC6p7+xfchde2bb/CAeJ7CwCp3w YCnmNRaYUWTMlf8gFqy638loQWpFI36q0Dr/APqg3lL7Geh7NMaec5f8BvUf1re5f2W0 wG/QMQFr1WFkZyEIVOj6AN4VjA3zJ/yY+gy7KpB9Vx2hPVijoXb2a74ffXgFucobhdS8 qXiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xBt0Ufe8; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id p18-20020a05622a00d200b0041996c8044dsi5826313qtw.307.2023.10.09.03.04.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Oct 2023 03:04:54 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xBt0Ufe8; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qpn73-0003UL-KF; Mon, 09 Oct 2023 06:03:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qpn6q-0003GO-Pa for qemu-devel@nongnu.org; Mon, 09 Oct 2023 06:03:33 -0400 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qpn6p-0000E1-8b for qemu-devel@nongnu.org; Mon, 09 Oct 2023 06:03:32 -0400 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-40684f53bfcso39820975e9.0 for ; Mon, 09 Oct 2023 03:03:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696845809; x=1697450609; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=vQJEL8vkJwny7eCI7iH0HAlqhSa/NiYKDVoeaT20KQc=; b=xBt0Ufe8jh3S90b0I7EhTDz3tEtAQ2/ygTSZFL1Gbm67S6ZBlM9on06RuPrUicv00U wwBtMD9q+WEqiSY5lz2MsoLAoz9wJkMRiFWBSdko7geK31v8GQH7vCLhSSxlmDLP7lG1 1jlVeqkOq0SrqYTHdIzrUKHWAup579NRPUOgvv2bMgJ9px0fmDhsJ8+gyjTyUKeu7g4F Ja9+hfrL+3D17c+RxDHBhijnBCH5bEpOnq5FPr8F451S7JG8H0Cg4vKwq75WdajtDlM2 0spoxO/Ue6q50PKmG03EL8Fzy8y3uK6oss2X9fOj/JSn1yl2hjeiZbvAUDxR+6mEHlXW 1eGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696845809; x=1697450609; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vQJEL8vkJwny7eCI7iH0HAlqhSa/NiYKDVoeaT20KQc=; b=RW6aFVV9wmQCKNln6vCR05xJp9rmOHuU7jGcyCRnE588W56yJOxjEJT0YgwU/0SnId dd7n74pbDNTZrkQTZKlJyS8bT1AILctW8OtO5Hqq5wHuBr9TVBvRbIUfUpU8CCMi12SB 0wjE5sWwJg54tg0vHnYyFPLF1p1kzen5hSA3muFWvlrj8h24EdBNVQfT+KlasMcx0e86 lEIfq/RGL/+p1PIoZfe5PzJQEB/Q0xyyDbTiSzBMrCU1uXKStf5kYyR/5K9V633h7HO3 tYEPxELQIxkTJaF/8h9b6nFvL4VOwVx3JHryS2N3Rhh9CKpBfK9gBJaAOU+SDnj8mNtr 6F4w== X-Gm-Message-State: AOJu0Yxr6G9GeyMqIyJJKFFRUCl3bZUwQAJj1vV2dFWyhBYDLfwILv4d UNOTRF6QeWgNqn5FGCZLORMZJ7uHbnhXmqVNy4s= X-Received: by 2002:a05:600c:1d8f:b0:407:3630:f35 with SMTP id p15-20020a05600c1d8f00b0040736300f35mr8285061wms.9.1696845809280; Mon, 09 Oct 2023 03:03:29 -0700 (PDT) Received: from m1x-phil.lan (thr44-h01-176-170-217-185.dsl.sta.abo.bbox.fr. [176.170.217.185]) by smtp.gmail.com with ESMTPSA id z7-20020a7bc7c7000000b003fee567235bsm13006999wmk.1.2023.10.09.03.03.27 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 09 Oct 2023 03:03:28 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Alberto Garcia , Hao Wu , Kevin Wolf , Thomas Huth , Laurent Vivier , Paolo Bonzini , qemu-block@nongnu.org, John Snow , Stefan Hajnoczi , Fam Zheng , Tyrone Ting , Markus Armbruster , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PATCH 06/10] tests/rtl8139: Clean up global variable shadowing Date: Mon, 9 Oct 2023 12:02:47 +0200 Message-ID: <20231009100251.56019-7-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231009100251.56019-1-philmd@linaro.org> References: <20231009100251.56019-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=philmd@linaro.org; helo=mail-wm1-x336.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Rename the variable to fix: tests/qtest/rtl8139-test.c:28:33: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] static void save_fn(QPCIDevice *dev, int devfn, void *data) ^ tests/qtest/rtl8139-test.c:37:17: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] QPCIDevice *dev; ^ tests/qtest/rtl8139-test.c:25:20: note: previous declaration is here static QPCIDevice *dev; ^ Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth --- tests/qtest/rtl8139-test.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/qtest/rtl8139-test.c b/tests/qtest/rtl8139-test.c index 4dc0a0d22e..eedf90f65a 100644 --- a/tests/qtest/rtl8139-test.c +++ b/tests/qtest/rtl8139-test.c @@ -22,7 +22,7 @@ static void nop(void) #define CLK 33333333 static QPCIBus *pcibus; -static QPCIDevice *dev; +static QPCIDevice *pcidev; static QPCIBar dev_bar; static void save_fn(QPCIDevice *dev, int devfn, void *data) @@ -46,7 +46,7 @@ static QPCIDevice *get_device(void) #define PORT(name, len, val) \ static unsigned __attribute__((unused)) in_##name(void) \ { \ - unsigned res = qpci_io_read##len(dev, dev_bar, (val)); \ + unsigned res = qpci_io_read##len(pcidev, dev_bar, (val)); \ if (verbosity_level >= 2) { \ g_test_message("*%s -> %x", #name, res); \ } \ @@ -57,7 +57,7 @@ static void out_##name(unsigned v) \ if (verbosity_level >= 2) { \ g_test_message("%x -> *%s", v, #name); \ } \ - qpci_io_write##len(dev, dev_bar, (val), v); \ + qpci_io_write##len(pcidev, dev_bar, (val), v); \ } PORT(Timer, l, 0x48) @@ -189,11 +189,11 @@ static void test_init(void) { uint64_t barsize; - dev = get_device(); + pcidev = get_device(); - dev_bar = qpci_iomap(dev, 0, &barsize); + dev_bar = qpci_iomap(pcidev, 0, &barsize); - qpci_device_enable(dev); + qpci_device_enable(pcidev); test_timer(); } From patchwork Mon Oct 9 10:02:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 730990 Delivered-To: patch@linaro.org Received: by 2002:ab3:7922:0:b0:23f:8cfb:5ad7 with SMTP id j2csp1290902ltl; Mon, 9 Oct 2023 03:07:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE6Rt5IbBvBic5MLRKdjzZqvtcKe9Jd41BYRod6eVrMr0SjLk8DN/p/cxwu9dkRVq5hKmGu X-Received: by 2002:a05:622a:11c5:b0:418:79a:e350 with SMTP id n5-20020a05622a11c500b00418079ae350mr19020077qtk.23.1696846021909; Mon, 09 Oct 2023 03:07:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696846021; cv=none; d=google.com; s=arc-20160816; b=SHyxU36ojG8pHOTtgb9aSCXRbT+WPUCXLARipFFsQ0Suhu+qedcKuqNoxUyIfBcXMv N4yb1rKMozd/RjqdTvnuRYYZVGlJRx2YBZDbXT/zZV5KRJe/v0ljllMzXFZb0S6L8SxU pebeA0ZfTFOTPL9Cub28BV40VMwf0SwYsENwWQsxolKkfyswTNWB50imvQdyJUdxKp22 RPp11shYsWIAII84OltOEUvyCd0/Du2N+UbBjgLJnMIabAS7ndjpNuM3DUhCgR0/HVka r6IGDcNU60OBEhm2UH+zEmlVDL6X7coUdJgis/myQm5pZI/iO4d4iqFraJaFsrRqSw3L n22g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Csk84OALb8Q47k8SHL9RxynHS9qNYD6xloMNS+mez1Q=; fh=+UA/OvAzPt1sCt0A7U0kURxgTxGl33GhvbTVlpu8K7o=; b=AN2bMAz8AJ4U9Kz0OA9VFlMoG0XhE6H3axrVFULfF5Z8LFPZErpohsOnB+OXX0sZ7H SK4UWXQdjrF9P6b7n90lQ0Uz/DJXpk3EkkLKJzn1CfjdQk5kMI7xMHCTMtTL9Fht5uZy DYq31SNtXeYQg0Maz4lB3Y96gTH1ieFtaq4FVN1Pa47JkD9Pz0yCH4ZvjH15RZmCRP31 GFmlmkjD+ATCGEjJsQIsdQ0zyWZvm6BvPTRn4adyG2Mx2y3R1LUbnHAZN5Gc+0bgyWxy X3bREOCSpJ6eQaQCRtpzgt6jPS5qiqYUXLfuk+FBxlP2wf9vDdM2x8htnhOgXse/Ks3b GmiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zN6Cr1B4; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id w1-20020ac857c1000000b0041212556418si5879290qta.658.2023.10.09.03.07.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Oct 2023 03:07:01 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zN6Cr1B4; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qpn74-0003Vx-G4; Mon, 09 Oct 2023 06:03:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qpn70-0003P4-Jp for qemu-devel@nongnu.org; Mon, 09 Oct 2023 06:03:43 -0400 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qpn6v-0000F0-9k for qemu-devel@nongnu.org; Mon, 09 Oct 2023 06:03:41 -0400 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-40684f53bfcso39821925e9.0 for ; Mon, 09 Oct 2023 03:03:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696845815; x=1697450615; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Csk84OALb8Q47k8SHL9RxynHS9qNYD6xloMNS+mez1Q=; b=zN6Cr1B4PBnB8FvTSS1rtyEe2t/72GT18eWWuem3OErfj9/xw+WoDeuGwOHyOOexgx /y+xIz8SpZV9AuUb+O+OKyllmz1QyI/2oAaOVcSxugFr2ev+Jb1lS2NP6IP1VDv8V4GF EsbrctDLssFhxNDmCiG+lzkoR2yeAzZqLyqoLWF2EiPnci8GjpWJLLmTneW7J9/D70No o9AURB2MmcJ1Yirx9a32evQCLpWxpZfz+uCtAhi2uU2yh9JXz2JZeaVpSCrqOtUVF2eO 8v/74vb0fVO65GP0p0EcWhpniCMFC1gPWqH+7JHxCZgIBtBzSswNG3NEYxaLqO7Vsq0U nmsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696845815; x=1697450615; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Csk84OALb8Q47k8SHL9RxynHS9qNYD6xloMNS+mez1Q=; b=Uus9iHdavPpZei+obSbBKzxX+7f+1hBTwIg+yUTEoHuuig2XhrRuTmA0VGqBHYzdAN N9VbfRIGSTn8HTzBbVOhYfVP2GVggrRJXsMiHQ700+1+TTKF3sfacpr29k+v552GxdAZ PrNZsOd+9rtIw9zykjUt99AQH3BEzvgLifaHs3eTHPzlEqPtRVepyoC3opkSaEEj8cZ+ 7piBcWc0qYuCFmcXabNGhpnKyY02EoolUwdINGPQ4iOwBseszcfrYj6iD21XKYlPYAAF 0mXqpTyPMSehe0dqlRtQQsLL3EbOh7eChyF0+jrJwnLT2mHbW5WT/Mvm5SbjbTx1xP0c ONRw== X-Gm-Message-State: AOJu0YzMtZiojqdZ9+mDzdF6wz6qhcYJgLSTo7+zIRSSskWIhay5x8BE 51fl6sLl85JNDwvD3NHoAgIlyX7KAdABk/CebG8= X-Received: by 2002:a05:6000:186c:b0:321:6779:944d with SMTP id d12-20020a056000186c00b003216779944dmr19359600wri.47.1696845815218; Mon, 09 Oct 2023 03:03:35 -0700 (PDT) Received: from m1x-phil.lan (thr44-h01-176-170-217-185.dsl.sta.abo.bbox.fr. [176.170.217.185]) by smtp.gmail.com with ESMTPSA id n10-20020a5d4c4a000000b00323287186aasm9142230wrt.32.2023.10.09.03.03.33 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 09 Oct 2023 03:03:34 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Alberto Garcia , Hao Wu , Kevin Wolf , Thomas Huth , Laurent Vivier , Paolo Bonzini , qemu-block@nongnu.org, John Snow , Stefan Hajnoczi , Fam Zheng , Tyrone Ting , Markus Armbruster , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PATCH 07/10] tests/npcm7xx_adc: Clean up global variable shadowing Date: Mon, 9 Oct 2023 12:02:48 +0200 Message-ID: <20231009100251.56019-8-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231009100251.56019-1-philmd@linaro.org> References: <20231009100251.56019-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=philmd@linaro.org; helo=mail-wm1-x32d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Rename the global 'adc' variable in order to avoid: tests/qtest/npcm7xx_adc-test.c:98:58: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] static uint32_t adc_read_con(QTestState *qts, const ADC *adc) ^ tests/qtest/npcm7xx_adc-test.c:103:55: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] static void adc_write_con(QTestState *qts, const ADC *adc, uint32_t value) ^ tests/qtest/npcm7xx_adc-test.c:108:59: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] static uint32_t adc_read_data(QTestState *qts, const ADC *adc) ^ tests/qtest/npcm7xx_adc-test.c:119:53: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] static void adc_qom_set(QTestState *qts, const ADC *adc, ^ tests/qtest/npcm7xx_adc-test.c:135:57: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] static void adc_write_input(QTestState *qts, const ADC *adc, ^ tests/qtest/npcm7xx_adc-test.c:144:56: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] static void adc_write_vref(QTestState *qts, const ADC *adc, uint32_t value) ^ tests/qtest/npcm7xx_adc-test.c:162:59: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] static uint32_t adc_prescaler(QTestState *qts, const ADC *adc) ^ tests/qtest/npcm7xx_adc-test.c:175:64: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] static void adc_wait_conv_finished(QTestState *qts, const ADC *adc, ^ tests/qtest/npcm7xx_adc-test.c:196:16: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] const ADC *adc = adc_p; ^ tests/qtest/npcm7xx_adc-test.c:207:16: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] const ADC *adc = adc_p; ^ tests/qtest/npcm7xx_adc-test.c:235:16: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] const ADC *adc = adc_p; ^ tests/qtest/npcm7xx_adc-test.c:267:16: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] const ADC *adc = adc_p; ^ tests/qtest/npcm7xx_adc-test.c:293:16: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] const ADC *adc = adc_p; ^ tests/qtest/npcm7xx_adc-test.c:311:16: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] const ADC *adc = adc_p; ^ tests/qtest/npcm7xx_adc-test.c:93:5: note: previous declaration is here ADC adc = { ^ Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth --- tests/qtest/npcm7xx_adc-test.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/qtest/npcm7xx_adc-test.c b/tests/qtest/npcm7xx_adc-test.c index 8048044d28..e751a72e36 100644 --- a/tests/qtest/npcm7xx_adc-test.c +++ b/tests/qtest/npcm7xx_adc-test.c @@ -90,7 +90,7 @@ typedef struct ADC { uint64_t base_addr; } ADC; -ADC adc = { +ADC adc_defs = { .irq = 0, .base_addr = 0xf000c000 }; @@ -367,12 +367,12 @@ int main(int argc, char **argv) { g_test_init(&argc, &argv, NULL); - add_test(init, &adc); - add_test(convert_internal, &adc); - add_test(convert_external, &adc); - add_test(interrupt, &adc); - add_test(reset, &adc); - add_test(calibrate, &adc); + add_test(init, &adc_defs); + add_test(convert_internal, &adc_defs); + add_test(convert_external, &adc_defs); + add_test(interrupt, &adc_defs); + add_test(reset, &adc_defs); + add_test(calibrate, &adc_defs); return g_test_run(); } From patchwork Mon Oct 9 10:02:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 730987 Delivered-To: patch@linaro.org Received: by 2002:ab3:7922:0:b0:23f:8cfb:5ad7 with SMTP id j2csp1290137ltl; Mon, 9 Oct 2023 03:05:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEZPergtDTZj6pTAvja7qX7RorXrM2qgnfad1XethOIDAGMdIzlVn0qrg3rAAyEuhnWaO7e X-Received: by 2002:a0c:c407:0:b0:65b:239f:677d with SMTP id r7-20020a0cc407000000b0065b239f677dmr12004503qvi.64.1696845935826; Mon, 09 Oct 2023 03:05:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696845935; cv=none; d=google.com; s=arc-20160816; b=lk2tUH7GtPEdY/wqcKGo/lMiSfnWZXXBlRr1FvKeCSg5cubpmchGbiqpPZRb3dZ2hF OsUgUMViatVCOU++Smj0Q1C0i0zfNGjYMjGBJ40KZMA6LpLNP+Kw1px84zu8wr6ffa+A QeEvVVPFVke4MKQBj+qIn9trd2V2FSUPBBMP2j48TrfQfNOcA6Q9TbCIO/b2boIt2SqV FQNK+p1frh9fmnPJ4s4sIMRxTHxZY5abZde/G45EHTeEXIHcjizzgtLgwHw3rOw6JsX4 TgaSYgZXKI59fRmBCKyWJx78DQ1wHRYdSfT2mCU9xToB4yMglDNrIk8YNQeSIEcOPhrY kjMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=iSzCHIdmj0ACDSZfJdt/n9uVk8fHj/Z/ypjnOvyiyyQ=; fh=+UA/OvAzPt1sCt0A7U0kURxgTxGl33GhvbTVlpu8K7o=; b=DNXWM/M3r9Cpz+GQepYrQtKOft8TpXscXQhc/ntQdVBg2TLOgV0hUTcCF9vY2D1Zgf r3wc4CzlDDVaA53peTGMehYZYRgpTv+jMttzIcK/mP9/5pUvBSa9yQkpV23YuDGxxUne Nh4QUH6VZbRx3xwCCJJERp5A3ZfZ6FWfHPn0aODyfgOVh3scH8YyBrNgXg2KhXsWBede qvHg01lewYQyitg//BrKoOk7NiSBLxg/7H49pftJC+IQjsPttOJxEqF0nMFUJxdX6QVN em0CjNrtY9UGpUmX5Sk6HnyRPshhjh9A8RJd+IOFcM2sVsyCOhmAfKPAzV4GtLZ8KoLW 0fIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VsSpVz3q; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id b19-20020a0ccd13000000b0065b12b1d559si5879151qvm.284.2023.10.09.03.05.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Oct 2023 03:05:35 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VsSpVz3q; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qpn7G-0003yC-31; Mon, 09 Oct 2023 06:03:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qpn7D-0003oS-TS for qemu-devel@nongnu.org; Mon, 09 Oct 2023 06:03:55 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qpn71-0000HJ-Sh for qemu-devel@nongnu.org; Mon, 09 Oct 2023 06:03:55 -0400 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-32157c8e4c7so4323708f8f.1 for ; Mon, 09 Oct 2023 03:03:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696845821; x=1697450621; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=iSzCHIdmj0ACDSZfJdt/n9uVk8fHj/Z/ypjnOvyiyyQ=; b=VsSpVz3qWINYyFrX77Fht7WUw7EvnZhqvO1AWsKHj+npp/+nYRu33J9Ezl6w9RS18X Mcy1gJY5+J82CrV72YFFBltIZ4QR+F5CR8/LR9pc8To5efN4pIFRGGKG7sU9tiwe3E6p OjoKTDHvOjKxlefmec8u672hBLwTe+8C4rIYga72LqJ4TSreDITNR/IKnInNqlvEk4h1 T7Y0pLdyvD+4+3w48Eg/NiHN+uH+TEE1yG8r5q7gNpmLBYIKptA+W8g15bknEysL+Jvt A1Gr02BoiA54lWWiuhknD3l54xhFf6gc166QY6okWVH7jmbo9fRJEXjwpd1IWNeKshYW YIlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696845821; x=1697450621; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=iSzCHIdmj0ACDSZfJdt/n9uVk8fHj/Z/ypjnOvyiyyQ=; b=nSnqqm0hf8Q7nBO5x4GB5hSF+w5zXQzB4qLa0Z4JIWFwjzg++tQVMFjk5k65h6RpXx xGLQplkef9ToiDDor1IXQ0PhXbsOg1U1U02HwMJeMZKMXwRa/8knr0lDjX4eFYWatFME DcZWJJ0l1ZimqCHbG6G3Fu7ROjcQshbYVmWKaa1c0hjbt8g/AwZsKe+VJSmGG6v6rYW9 +gx//6Tmnb4tFye+OzSutaBYMU8yGEGDubesdGl+Lxal30Ki0J9fquH6DdXGtJnj9soy ddNfAoT4s1khRzort/qDY6FLcq3jjsEQBVjJ0gs7KhK2Xt/wdzNNC8Fkp9BTfGM6Nvg3 f69g== X-Gm-Message-State: AOJu0YzjkFlyp5f/Mi+8fXKP3XH83Lbu4BUk7eLGuX2Zv5kSkfv7emQR HJSdc0WQPwL2EZG6pWiIsAXuebyaUVnzNsXnWZA= X-Received: by 2002:adf:cc81:0:b0:321:5971:23a5 with SMTP id p1-20020adfcc81000000b00321597123a5mr13194274wrj.20.1696845821011; Mon, 09 Oct 2023 03:03:41 -0700 (PDT) Received: from m1x-phil.lan (thr44-h01-176-170-217-185.dsl.sta.abo.bbox.fr. [176.170.217.185]) by smtp.gmail.com with ESMTPSA id a11-20020adff7cb000000b00326f0ca3566sm9100072wrq.50.2023.10.09.03.03.39 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 09 Oct 2023 03:03:40 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Alberto Garcia , Hao Wu , Kevin Wolf , Thomas Huth , Laurent Vivier , Paolo Bonzini , qemu-block@nongnu.org, John Snow , Stefan Hajnoczi , Fam Zheng , Tyrone Ting , Markus Armbruster , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PATCH 08/10] tests/aio: Clean up global variable shadowing Date: Mon, 9 Oct 2023 12:02:49 +0200 Message-ID: <20231009100251.56019-9-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231009100251.56019-1-philmd@linaro.org> References: <20231009100251.56019-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=philmd@linaro.org; helo=mail-wr1-x429.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Rename the argument to fix: tests/unit/test-aio.c:130:44: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] static void set_event_notifier(AioContext *ctx, EventNotifier *notifier, ^ tests/unit/test-aio.c:22:20: note: previous declaration is here static AioContext *ctx; ^ Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth --- tests/unit/test-aio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unit/test-aio.c b/tests/unit/test-aio.c index 71ed31a4db..337b6e4ea7 100644 --- a/tests/unit/test-aio.c +++ b/tests/unit/test-aio.c @@ -127,10 +127,10 @@ static void *test_acquire_thread(void *opaque) return NULL; } -static void set_event_notifier(AioContext *ctx, EventNotifier *notifier, +static void set_event_notifier(AioContext *nctx, EventNotifier *notifier, EventNotifierHandler *handler) { - aio_set_event_notifier(ctx, notifier, handler, NULL, NULL); + aio_set_event_notifier(nctx, notifier, handler, NULL, NULL); } static void dummy_notifier_read(EventNotifier *n) From patchwork Mon Oct 9 10:02:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 730983 Delivered-To: patch@linaro.org Received: by 2002:ab3:7922:0:b0:23f:8cfb:5ad7 with SMTP id j2csp1289566ltl; Mon, 9 Oct 2023 03:04:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFlwYAAlxx2t+5wvigncYEGDzAdBuehdRxOXQPIkOkWJZHp9H91xKZFol7EwAP1U8qffSAf X-Received: by 2002:a05:622a:1310:b0:410:9b3c:e828 with SMTP id v16-20020a05622a131000b004109b3ce828mr18247550qtk.37.1696845868165; Mon, 09 Oct 2023 03:04:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696845868; cv=none; d=google.com; s=arc-20160816; b=Pzd7ptvo/4OF/EFu3rXSL917H5FCjNnvWyYepEQZKGsl3Uyv2uS4tfNT0oCAtq5Rrs kPhFEoTEJvfhOuyrn4MS15UR0+zF6GDl9xe6+cFfz1M9Yz7JxjJ563Ecpy7EYnvZWOWk DV/1jjbOHu4LkDk6dfXxnNLO7WZzhDNsO0zX7oadQVsZTqzJK4EoQEopL01USg4W/mbc JqPWDRz9nZgHxtTPY32VXj8ok9ujTHhXJsdHcHji5RR4kT4q51cK25moWcKqy7cOxiz6 QCH6b6rIUvSncZl2ZdtUcNxv+5x++fW7WsnrL1qYkY9AL5N8/lfVDkhPNLmtAMfdUomM nMVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=j5BNGs+G3EOO05KikjnRTYDtKwetCUKmXOLb4daofrU=; fh=+UA/OvAzPt1sCt0A7U0kURxgTxGl33GhvbTVlpu8K7o=; b=Cn9hZhZHz+LbIsdAelhnPkOJdOfyxxV6NvM6ThWCraL7us240XQFwlyFcXBqK+x6Af bEvLuRnJU9uRu0sncEI6zKO3ABnJWkGOYfBihtg6Pq1eweeRfZkA9nlLU9pWKV81Eear 4fCA6eR7r04nKe0xrfrokrdis7u1VO25IiO5VfbE0nzkLM+TKE1jfQICP7V376OaIZMr 8YQQm+9r/aNPv2deafkJw4bLwzleKNs6rp4t+7jTUV11z/awd0ImPZsMwssvvPhowU3/ 8sLf7lJfoLKEkY+/TM2zv0d7OFgo4rwfU/0+2jSNro58tMSX9GU4n3uz2YNb+Df/F+FS pgrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qfbbI8yY; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id v3-20020a05622a144300b004195f30d7f3si6031550qtx.698.2023.10.09.03.04.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Oct 2023 03:04:28 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qfbbI8yY; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qpn7E-0003rF-8L; Mon, 09 Oct 2023 06:03:56 -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 1qpn7C-0003nQ-H6 for qemu-devel@nongnu.org; Mon, 09 Oct 2023 06:03:54 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qpn77-0000I4-LU for qemu-devel@nongnu.org; Mon, 09 Oct 2023 06:03:54 -0400 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-323ef9a8b59so4140096f8f.3 for ; Mon, 09 Oct 2023 03:03:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696845827; x=1697450627; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=j5BNGs+G3EOO05KikjnRTYDtKwetCUKmXOLb4daofrU=; b=qfbbI8yY8NqDqpTFU+Q0fKIRBefTR95t+xv8lSMJNuXM5bOZLA/wKOQgh1SutgezcJ ZQehS0at/51Tsq0c3w5NdIc7wgTqcwv98meR9oBYUGmTXfNy5tYMZDHI96d8MyjJMzD+ NmYfEoyPea9/Hcgfz90JIyirbMgnv9cDwswcIxiui3rfGMAyzJtr9R6StzrB6GhiT42V M53BmAeLf16KmoXUVFXt+aCy34XUzfIO5lJor9sa9DOE2ZLDceUPySlfhYO+zNmQrMVl HsDq0PW7Si/l8LZusI1Xb3eQ6gtPlBKWQvoeLNG/VVdjQWSsLKAyLTtiRN8DSNzV7Ibz bSSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696845827; x=1697450627; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=j5BNGs+G3EOO05KikjnRTYDtKwetCUKmXOLb4daofrU=; b=EPI1q9gFDZrWiv1TTzaDXgYF5RPXtnoHxy8kEFnGzoGVKn22gT2kirrq+qZVlKg20f Op1SYhfxmm5NMdpi9sBvkK56jCGJHbtUPbVKzse25vjh8pDQcDyvBVi4PVClhpuqsz4i VFlM5apLAEecY/Tkh8b8tQXe7BKnR5nkS8Mf6nyvaha7dG8H/J09OF7kk0XpN8JsiIVJ yw2M8kX3eUMmV/QD05XqG9GWFr6zEbp9pRGx3nowFPhi0n9oFQAJGYeDsQtCqq2/pQUv 3jy5Ev0hNKxLnyreo5UwCyVXOoF0OEvvNM1KyAtCVVuWP7wsZAfr651tKX8m3mFpyeSL /m3w== X-Gm-Message-State: AOJu0YwLpfhQeNA+IG0wE8G9rbWRIuTBdYdFEFx1vaNry221AHAo0VSF lg5wXkSL7taS+0n2C34fKevdvxj78edafdPK09M= X-Received: by 2002:a05:6000:186c:b0:321:6779:944d with SMTP id d12-20020a056000186c00b003216779944dmr19360377wri.47.1696845826765; Mon, 09 Oct 2023 03:03:46 -0700 (PDT) Received: from m1x-phil.lan (thr44-h01-176-170-217-185.dsl.sta.abo.bbox.fr. [176.170.217.185]) by smtp.gmail.com with ESMTPSA id z3-20020adfec83000000b0032327b70ef6sm9238656wrn.70.2023.10.09.03.03.45 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 09 Oct 2023 03:03:46 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Alberto Garcia , Hao Wu , Kevin Wolf , Thomas Huth , Laurent Vivier , Paolo Bonzini , qemu-block@nongnu.org, John Snow , Stefan Hajnoczi , Fam Zheng , Tyrone Ting , Markus Armbruster , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PATCH 09/10] tests/aio-multithread: Clean up global variable shadowing Date: Mon, 9 Oct 2023 12:02:50 +0200 Message-ID: <20231009100251.56019-10-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231009100251.56019-1-philmd@linaro.org> References: <20231009100251.56019-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=philmd@linaro.org; helo=mail-wr1-x42f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Rename the argument to avoid: tests/unit/test-aio-multithread.c:226:37: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] static void test_multi_co_mutex(int threads, int seconds) ^ tests/unit/test-aio-multithread.c:401:34: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] static void test_multi_mutex(int threads, int seconds) ^ tests/unit/test-aio-multithread.c:24:18: note: previous declaration is here static IOThread *threads[NUM_CONTEXTS]; ^ Signed-off-by: Philippe Mathieu-Daudé --- tests/unit/test-aio-multithread.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/unit/test-aio-multithread.c b/tests/unit/test-aio-multithread.c index 08d4570ccb..d587f20667 100644 --- a/tests/unit/test-aio-multithread.c +++ b/tests/unit/test-aio-multithread.c @@ -223,7 +223,7 @@ static void coroutine_fn test_multi_co_mutex_entry(void *opaque) qatomic_dec(&running); } -static void test_multi_co_mutex(int threads, int seconds) +static void test_multi_co_mutex(unsigned ctx_num, int seconds) { int i; @@ -233,9 +233,9 @@ static void test_multi_co_mutex(int threads, int seconds) now_stopping = false; create_aio_contexts(); - assert(threads <= NUM_CONTEXTS); - running = threads; - for (i = 0; i < threads; i++) { + assert(ctx_num <= NUM_CONTEXTS); + running = ctx_num; + for (i = 0; i < ctx_num; i++) { Coroutine *co1 = qemu_coroutine_create(test_multi_co_mutex_entry, NULL); aio_co_schedule(ctx[i], co1); } @@ -398,7 +398,7 @@ static void test_multi_mutex_entry(void *opaque) qatomic_dec(&running); } -static void test_multi_mutex(int threads, int seconds) +static void test_multi_mutex(unsigned ctx_num, int seconds) { int i; @@ -408,9 +408,9 @@ static void test_multi_mutex(int threads, int seconds) now_stopping = false; create_aio_contexts(); - assert(threads <= NUM_CONTEXTS); - running = threads; - for (i = 0; i < threads; i++) { + assert(ctx_num <= NUM_CONTEXTS); + running = ctx_num; + for (i = 0; i < ctx_num; i++) { Coroutine *co1 = qemu_coroutine_create(test_multi_mutex_entry, NULL); aio_co_schedule(ctx[i], co1); } From patchwork Mon Oct 9 10:02:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 730985 Delivered-To: patch@linaro.org Received: by 2002:ab3:7922:0:b0:23f:8cfb:5ad7 with SMTP id j2csp1289781ltl; Mon, 9 Oct 2023 03:04:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGZZHyUFb6LWIdQ4xLSAPq0kmpT9QfcCOx6PFxfWqpNxU5wJ2gtxjlO/EJ29llkrN7mLJMI X-Received: by 2002:a05:6214:3d8a:b0:65b:31df:df62 with SMTP id om10-20020a0562143d8a00b0065b31dfdf62mr14480004qvb.30.1696845895549; Mon, 09 Oct 2023 03:04:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696845895; cv=none; d=google.com; s=arc-20160816; b=t0OsJ2oaxLEv9NvRD8pgqHJmsGD03D3fZPFYYGFxhT2ASRdXg5PueGnGJlnWOcUoz3 9S25Fpb4DxsJYvPhoQ+Pwu8Vqj+T8cH7plt2g2Ztj42OnJe5qUVA3TiDznQ/Y5Z+XSiN bRguzO2+03xWnQr1C08ILp+vhiWRBltQY2oqTxGsjVqO7RLVDRVTIAWQtmIKe3v4khxn nOkIMrkoQtZfbvmsJQiErCNbwh5XyQ5N0AW/NJSn0GVpG7Fo6dA5GhIiP0J5hISDf6i5 2EXXBIIBvuDsAX7xm1YQakOeX6VzMAsIn1UET1MSHbtF6iiMvJYwePIdYfek4Gg17gem ow+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=yM3tQ6WCStP5GxgcqqxDxvp5O7sg3JFTcxjMkWzVHZg=; fh=+UA/OvAzPt1sCt0A7U0kURxgTxGl33GhvbTVlpu8K7o=; b=Avfdw3a9qROEezOZYqq/3ha6iT5uXKDRulv60E6XZSAPUoRYDyaJ/epAtx0okL/xlV xNq6r2PWzGkeB5ZYd9tvrlXmiuauWzZeRFUjFISCYmqiBXy1Bnp+R+omGDlGhFF0eajf 7Fn2gc2rMGHOAV6ew1RCIZ0Yz6l//edwoq8VZjEwVGY+HkJ8nwS+RvXXcH54S4F/E0Ix 8baxtNYIGsCXdBCsTHY/OtsZeRLFqFetLjBzlOLNRxSnOTKLaWwEb4N3inmuw8tCGdKt VWs+4Dxu9B91rorkNYOSBxMHSBZPw1nA1WavdJp3nzG1nLxaJdjFLJgCsqjxZinn/kFU s4JQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=G4U1KfQC; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id b24-20020a0cb3d8000000b0065d05afb84esi5740155qvf.350.2023.10.09.03.04.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Oct 2023 03:04:55 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=G4U1KfQC; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qpn7G-00040F-QV; Mon, 09 Oct 2023 06:03:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qpn7F-0003uB-2F for qemu-devel@nongnu.org; Mon, 09 Oct 2023 06:03:57 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qpn7C-0000Im-4Z for qemu-devel@nongnu.org; Mon, 09 Oct 2023 06:03:56 -0400 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-327be5fe4beso3952376f8f.3 for ; Mon, 09 Oct 2023 03:03:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696845832; x=1697450632; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=yM3tQ6WCStP5GxgcqqxDxvp5O7sg3JFTcxjMkWzVHZg=; b=G4U1KfQCJyhWiPQBVyEuh7xX0UYNW+SmaGsAIL4ks0WZNNFKV4umm9c+USn5nsmT25 npSi1o0RR89dLmUBVd8l4b9DCS5tRshEnEGWNuXHIh/ajgkI7qEtpRb9ujHyeo4fZ0ef mfCQE1eUt7169TM8rYYKtgF3JZkYfK0xUGwC9KMzgc6kYkrwz4tVfB4iaWjKM3w8qHPn zvuBefJ9hN1SoA6LmNZ0ifAAHo8ZiYxcS72OlWyZuib4kNbUGOifiXYoBGudKsAebYnu kASbaKC/MOmL95yAMx8X302Mm1+UAIMFskXqQlKfvZWTrmDrIhJR9L+saJ/S/NXxh/oL ostw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696845832; x=1697450632; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yM3tQ6WCStP5GxgcqqxDxvp5O7sg3JFTcxjMkWzVHZg=; b=JZndEEAb6Nlf+3PBpufMKFFCJ1F3T+uEaa2G5bLGDjt5kh4ULlU7T289y5iaY+cdNi maIDO3L8GZXezvCW+IWPqOcvP3xpIzrH5go8OzaFI5unozALdNNrmb1LpRa/0l+KJPPi s/TVf3IFFvlx5qS9W1x3M9WJgoTUKp52xtOmQ5C67SRfs/p/olDkOLzPCNe/j3VyGo7H CZnAzprQ253FzlSuf8GUSWtnTn69t6qpil6MmFY7Y5GTcH5SlN9ecDOai6dzx3bLI088 hrrRfDUjJIsBtBDldrlGSFmCRGFwpfHJT9uW9gElQgst8j7dbFI+TZwL6IuZIDoc3ac9 NcqQ== X-Gm-Message-State: AOJu0YyDF87WI5R4vTmL60JCMTWDASvoSrclr764/8kiLjB1BSd+gu4a Ei4xswATOLNKyS6Ds0cIDYk3un+zg+R2TLDTah4= X-Received: by 2002:adf:e9d0:0:b0:31f:f432:b541 with SMTP id l16-20020adfe9d0000000b0031ff432b541mr13007184wrn.69.1696845832575; Mon, 09 Oct 2023 03:03:52 -0700 (PDT) Received: from m1x-phil.lan (thr44-h01-176-170-217-185.dsl.sta.abo.bbox.fr. [176.170.217.185]) by smtp.gmail.com with ESMTPSA id b5-20020a056000054500b00326dd5486dcsm9172575wrf.107.2023.10.09.03.03.51 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 09 Oct 2023 03:03:52 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Alberto Garcia , Hao Wu , Kevin Wolf , Thomas Huth , Laurent Vivier , Paolo Bonzini , qemu-block@nongnu.org, John Snow , Stefan Hajnoczi , Fam Zheng , Tyrone Ting , Markus Armbruster , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PATCH 10/10] tests/coroutine: Clean up global variable shadowing Date: Mon, 9 Oct 2023 12:02:51 +0200 Message-ID: <20231009100251.56019-11-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231009100251.56019-1-philmd@linaro.org> References: <20231009100251.56019-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=philmd@linaro.org; helo=mail-wr1-x42f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Rename the global variable to avoid: tests/unit/test-coroutine.c:430:11: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] bool *done = opaque; ^ tests/unit/test-coroutine.c:438:10: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] bool done = false; ^ tests/unit/test-coroutine.c:198:12: note: previous declaration is here static int done; ^ Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth --- tests/unit/test-coroutine.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/unit/test-coroutine.c b/tests/unit/test-coroutine.c index b0d21d673a..29695cbdcb 100644 --- a/tests/unit/test-coroutine.c +++ b/tests/unit/test-coroutine.c @@ -195,7 +195,7 @@ static void test_no_dangling_access(void) } static bool locked; -static int done; +static int done_count; static void coroutine_fn mutex_fn(void *opaque) { @@ -206,7 +206,7 @@ static void coroutine_fn mutex_fn(void *opaque) qemu_coroutine_yield(); locked = false; qemu_co_mutex_unlock(m); - done++; + done_count++; } static void coroutine_fn lockable_fn(void *opaque) @@ -218,7 +218,7 @@ static void coroutine_fn lockable_fn(void *opaque) qemu_coroutine_yield(); locked = false; qemu_lockable_unlock(x); - done++; + done_count++; } static void do_test_co_mutex(CoroutineEntry *entry, void *opaque) @@ -226,7 +226,7 @@ static void do_test_co_mutex(CoroutineEntry *entry, void *opaque) Coroutine *c1 = qemu_coroutine_create(entry, opaque); Coroutine *c2 = qemu_coroutine_create(entry, opaque); - done = 0; + done_count = 0; qemu_coroutine_enter(c1); g_assert(locked); qemu_coroutine_enter(c2); @@ -235,11 +235,11 @@ static void do_test_co_mutex(CoroutineEntry *entry, void *opaque) * terminates. */ qemu_coroutine_enter(c1); - g_assert_cmpint(done, ==, 1); + g_assert_cmpint(done_count, ==, 1); g_assert(locked); qemu_coroutine_enter(c2); - g_assert_cmpint(done, ==, 2); + g_assert_cmpint(done_count, ==, 2); g_assert(!locked); }