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); }