From nobody Wed Nov 27 23:30:19 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=1696845969; cv=none; d=zohomail.com; s=zohoarc; b=h1ZbKSXPTN5WCo0u17w+p/lUBDzf7a0bUEpN2T5guYn1H/JdHezHK4vCG2NOcm6JpH3YXVViuB2j4NE3AJ/z/Xj8j72RIBL9SA1p6OmvG4YJDOQfsxQ2VQOW1sr+yzTQY9XSAoBF0aQok962l+A164W9jSvL2AGcjT6MFK7olDo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696845969; 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=tV1dKtatvnpslv9IY1Ow2PCBM/jxT9Mvzt/XqDZ+aVE=; b=gGPxD1Lu7bqty2as11Ds+GN0LLLECK8ddJaYO0BVoR7iNRU7Avm28eE/X5bPaMg2lCpFXMEdMijOzvdLYe7ZeYnRZNWoCh9iYiFfAjwLDlRdSQz3K5RWFjiOWMeUrzF8KwkZKhGu4rGTf7kVUtW91RduAS95SYaulV36r6WbatA= 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 1696845969365677.7949030828228; Mon, 9 Oct 2023 03:06:09 -0700 (PDT) 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) 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) 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-Google-Smtp-Source: AGHT+IGGPZwRUmfq0aik9grg53A3iGCiS7xFvgeog0+qk6Vo78/tHl7sSfYNuWPRC4Hlret45wznjw== 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) 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 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 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::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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1696845970130100001 Rename the variable to fix: tests/qtest/hd-geo-test.c:610:11: error: declaration shadows a variable i= n 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=C3=A9 --- 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] =3D { }; =20 static char *img_file_name[backend_last]; +static char *qcow2_imgpath; =20 static const CHST *cur_ide[4]; =20 @@ -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; =20 g_assert(args->n_drives < MAX_DRIVES); =20 - img_file_name =3D create_qcow2_with_mbr(mbr, sectors); + qcow2_imgpath =3D create_qcow2_with_mbr(mbr, sectors); =20 - args->drives[args->n_drives] =3D img_file_name; + args->drives[args->n_drives] =3D qcow2_imgpath; ret =3D snprintf(part, sizeof(part), "-drive file=3D%s,if=3Dnone,format=3Dqcow2,id=3Ddisk%d", - img_file_name, args->n_drives); + qcow2_imgpath, args->n_drives); g_assert((0 < ret) && (ret <=3D sizeof(part))); args->argc =3D 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); + } =20 return ret; } --=20 2.41.0