From nobody Thu Nov 28 00:44:31 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1696845895; cv=none; d=zohomail.com; s=zohoarc; b=f8B0QzfB69KqBXZVbdDpJ9s4O8HyH1iwNeAS9JJnJ1sO0H3bstlRGtS7Y+mR8tWeWWpekJROKGDzguBR33hNjHlM9QEIZ7fEwdDbUCd2lm4Ab0/7+5WVFiPHtdAXtmKFJw2T8vWTknF8gaYJ+oCCpL/XtCaeFNFIBIOu09+mtuo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696845895; 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=yM3tQ6WCStP5GxgcqqxDxvp5O7sg3JFTcxjMkWzVHZg=; b=Zdl5JF2cnK8e6uHnhwE/oChqEQYqPa5BthlVN+UxtRcpDkhKgdvwMZWQYOse8p6WTcGOPDYJbpNI5CXJEpzhBoVBfOtkPSenHwZTKQ90sMPCm1+IToANWqlHrK4A4i63+cmDqtSnGoFpwLSwoquAgidEWludGekQPIfAtxTR6+U= 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 1696845895823152.4616674101103; Mon, 9 Oct 2023 03:04:55 -0700 (PDT) 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) 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) 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-Google-Smtp-Source: AGHT+IF65qL4ZzIe5cmY4tQWwVR6r7XKPdAwA10ajUQ6cq890S3wLuV3NsCVlAQzzxqO9LnOEeb5WQ== 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) From: =?UTF-8?q?Philippe=20Mathieu-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=20Mathieu-Daud=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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1696845897793100007 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 =3D opaque; ^ tests/unit/test-coroutine.c:438:10: error: declaration shadows a variable= in the global scope [-Werror,-Wshadow] bool done =3D false; ^ tests/unit/test-coroutine.c:198:12: note: previous declaration is here static int done; ^ Signed-off-by: Philippe Mathieu-Daud=C3=A9 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) } =20 static bool locked; -static int done; +static int done_count; =20 static void coroutine_fn mutex_fn(void *opaque) { @@ -206,7 +206,7 @@ static void coroutine_fn mutex_fn(void *opaque) qemu_coroutine_yield(); locked =3D false; qemu_co_mutex_unlock(m); - done++; + done_count++; } =20 static void coroutine_fn lockable_fn(void *opaque) @@ -218,7 +218,7 @@ static void coroutine_fn lockable_fn(void *opaque) qemu_coroutine_yield(); locked =3D false; qemu_lockable_unlock(x); - done++; + done_count++; } =20 static void do_test_co_mutex(CoroutineEntry *entry, void *opaque) @@ -226,7 +226,7 @@ static void do_test_co_mutex(CoroutineEntry *entry, voi= d *opaque) Coroutine *c1 =3D qemu_coroutine_create(entry, opaque); Coroutine *c2 =3D qemu_coroutine_create(entry, opaque); =20 - done =3D 0; + done_count =3D 0; qemu_coroutine_enter(c1); g_assert(locked); qemu_coroutine_enter(c2); @@ -235,11 +235,11 @@ static void do_test_co_mutex(CoroutineEntry *entry, v= oid *opaque) * terminates. */ qemu_coroutine_enter(c1); - g_assert_cmpint(done, =3D=3D, 1); + g_assert_cmpint(done_count, =3D=3D, 1); g_assert(locked); =20 qemu_coroutine_enter(c2); - g_assert_cmpint(done, =3D=3D, 2); + g_assert_cmpint(done_count, =3D=3D, 2); g_assert(!locked); } =20 --=20 2.41.0