From nobody Wed May 15 16:42:07 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=1696420993; cv=none; d=zohomail.com; s=zohoarc; b=aashowf2yaVCWzdypMDCa9DdOHH8PN634LNSKGSM1Qa+/Y6yhZw+pnOaKb7Td+Fjpm4R16jYAqeWaoRTIl6rmwm+z79ha6Ezw8VK9VmST0ZgGAEqemnvlIviMcZAk4dYW5pt5e6hMMo1vfiRvWtkMO9Cg7W1Q6QNSOk+XhFbvSc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696420993; 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=0ChBQXwNW4QJm3R3JDhJpohyouOc36v+LlRUPzDRwbg=; b=GFS0fYoNciBGQ6vKyCmlv9EefSzSkHRFRDf0tjMfL5Ac6B6XeBM4Jgjnpr+w7ahFD4Iq8YbdfDOepZdq/mt5KI0Nde0vw78/Cy7Vp2PSMiSfPGzgo3b6xc5UBqzmcFQ+k2hvknfKwbRaoYMtKyn8V/YB5TYJ3jCciWt4jxswX2o= 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 1696420993165172.9784291619044; Wed, 4 Oct 2023 05:03:13 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qo0YO-0008SW-FA; Wed, 04 Oct 2023 08:00:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qo0YL-0008Qu-Sy for qemu-devel@nongnu.org; Wed, 04 Oct 2023 08:00:34 -0400 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qo0YJ-0000m3-LE for qemu-devel@nongnu.org; Wed, 04 Oct 2023 08:00:33 -0400 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-3214cdb4b27so2007772f8f.1 for ; Wed, 04 Oct 2023 05:00:31 -0700 (PDT) Received: from m1x-phil.lan (5ep85-h01-176-173-163-52.dslam.bbox.fr. [176.173.163.52]) by smtp.gmail.com with ESMTPSA id k5-20020a5d6e85000000b00327c79ca7c6sm3860165wrz.80.2023.10.04.05.00.27 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Oct 2023 05:00:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696420829; x=1697025629; 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=0ChBQXwNW4QJm3R3JDhJpohyouOc36v+LlRUPzDRwbg=; b=jeLv0vw2jRuxzHzu8rt+iCzjFZZX1Bpc71sS+QNZyV3vf8XchguyI8V/m8Sowsm8no +FmN9BH85yuZrxHbOl9hiY6y4yMmidNO1SquN1cVYcHuSqxYJV/4q9n4KRaUeELHI+O4 e2PfEgklGK3pOEflOrcztGuSicny4y2/Aal94dsZaM2Sub+yAB9DcQPqsZ7Q2yyUiVh4 RNZP4qpIe2j0IbviwLhrLj1kZYLwTkCy2gG5Uik21fOpXU607OF1PjC6fj2WuNH1ZUSp MmEH6g3hjW0cL+Z2o17cAeyJmfVSVTtRMjqwU6dQC/Q0/axmRGnpLhwDKo/a9OOVZHWA N/Rg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696420829; x=1697025629; 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=0ChBQXwNW4QJm3R3JDhJpohyouOc36v+LlRUPzDRwbg=; b=NFQLZkYYKxEP9Z9eUeDNOpZZDd8+/v6joUL4Rho35VKETLSTicCwN8cgzJ9O/eEEWR XTB6L/9Va+pziPasK8Q+wBOM4NYeQqMLERLwnEDH6addXoo9GWP0a0E5TfbTjuJ8UztC BWVQtnlouhQGWqavObt3Y0iqoYeFmLbiHbcqLVyHe5Pd5pq3atfWy263ZsLqhAN4hvv8 K/58Izy5XGfdZwRfDxyxFNFGjFQc+bw+58zIrQcG/kROAAkMJE6U2yItvQOmJNgkt2SE gdB69si/q+yIF+Cg7spJCTPxWlmxEC+B+jfBdfXxsePJH+dyM65FYDCIgN8W1zP2dXZX ZwiQ== X-Gm-Message-State: AOJu0Yyh5FDwNoQ8nwSS3mSeNl+80GVJFyiJhg3Uk1b0+eI6M2sftjD8 uwubtUQNV6FH4FImmrWygoSWVIFx5vfHTIhvTRw= X-Google-Smtp-Source: AGHT+IHnfkBvFfZVaWaol4sWKXVpE+VpCKpIvTMpTQJnk5YjXIxRK1bQ1VodJdkfn6yrWhV0NEtkgg== X-Received: by 2002:adf:fdd0:0:b0:31f:d7bb:481e with SMTP id i16-20020adffdd0000000b0031fd7bb481emr2161075wrs.63.1696420829014; Wed, 04 Oct 2023 05:00:29 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Markus Armbruster , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Gerd Hoffmann Subject: [PATCH v3 01/16] hw/audio/soundhw: Clean up global variable shadowing Date: Wed, 4 Oct 2023 14:00:04 +0200 Message-ID: <20231004120019.93101-2-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231004120019.93101-1-philmd@linaro.org> References: <20231004120019.93101-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::430; envelope-from=philmd@linaro.org; helo=mail-wr1-x430.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: 1696420995013100003 Fix: hw/audio/soundhw.c:86:33: error: declaration shadows a variable in the gl= obal scope [-Werror,-Wshadow] void select_soundhw(const char *optarg, const char *audiodev) ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/getopt.h:= 77:14: note: previous declaration is here extern char *optarg; /* getopt(3) external variables */ ^ Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Thomas Huth --- include/hw/audio/soundhw.h | 2 +- hw/audio/soundhw.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/hw/audio/soundhw.h b/include/hw/audio/soundhw.h index 270717a06a..474c5ff94e 100644 --- a/include/hw/audio/soundhw.h +++ b/include/hw/audio/soundhw.h @@ -8,6 +8,6 @@ void deprecated_register_soundhw(const char *name, const ch= ar *descr, =20 void soundhw_init(void); void show_valid_soundhw(void); -void select_soundhw(const char *optarg, const char *audiodev); +void select_soundhw(const char *name, const char *audiodev); =20 #endif diff --git a/hw/audio/soundhw.c b/hw/audio/soundhw.c index 94d9463e42..b387b0ef7d 100644 --- a/hw/audio/soundhw.c +++ b/hw/audio/soundhw.c @@ -83,7 +83,7 @@ void show_valid_soundhw(void) static struct soundhw *selected =3D NULL; static const char *audiodev_id; =20 -void select_soundhw(const char *optarg, const char *audiodev) +void select_soundhw(const char *name, const char *audiodev) { struct soundhw *c; =20 @@ -92,7 +92,7 @@ void select_soundhw(const char *optarg, const char *audio= dev) } =20 for (c =3D soundhw; c->name; ++c) { - if (g_str_equal(c->name, optarg)) { + if (g_str_equal(c->name, name)) { selected =3D c; audiodev_id =3D audiodev; break; @@ -100,7 +100,7 @@ void select_soundhw(const char *optarg, const char *aud= iodev) } =20 if (!c->name) { - error_report("Unknown sound card name `%s'", optarg); + error_report("Unknown sound card name `%s'", name); show_valid_soundhw(); exit(1); } --=20 2.41.0 From nobody Wed May 15 16:42:07 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=1696420931; cv=none; d=zohomail.com; s=zohoarc; b=a3kpseXD2pm9sy7YO3wEymZJlk6JwcIsWHwTfdCPvCqO8mJhLDX3fdIkxJzFxolaN/TwzvCkGbu4VMJndt5t8XP6Q6c+Fhc6tCd9eqq7MdKx07yevJfoohlcS0CAJGpvrDaSr8M0Pq5PHIDxPBw2ULug8ErGG1yB+UB39PNya8c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696420931; 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=TCSsB1yBxNop9ElFEQPzo8eRpaAPTBMtrtJV+7OJslM=; b=oG90ms6A1rG8SqRX75MA22j+7f3OebnmDYU4yjwr13uDoykd2vY3eElpZ7Ys+U4gYkFdmy5/UlCBTEL8IoZTm/u/YfcEAY4QQXK8BmoemCBsg083hUvrqj899y6pFUvGa+hIaLOVYAJDNjMrzsc501rZra8a+sEq0p2h1X5XKQA= 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 1696420931786141.40675244738043; Wed, 4 Oct 2023 05:02:11 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qo0ZK-0000Ib-Aj; Wed, 04 Oct 2023 08:01:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qo0YQ-0008Tq-0Q for qemu-devel@nongnu.org; Wed, 04 Oct 2023 08:00:38 -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 1qo0YO-0000xi-IH for qemu-devel@nongnu.org; Wed, 04 Oct 2023 08:00:37 -0400 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-405417465aaso20780485e9.1 for ; Wed, 04 Oct 2023 05:00:36 -0700 (PDT) Received: from m1x-phil.lan (5ep85-h01-176-173-163-52.dslam.bbox.fr. [176.173.163.52]) by smtp.gmail.com with ESMTPSA id v11-20020adfedcb000000b0031fd849e797sm3845151wro.105.2023.10.04.05.00.33 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Oct 2023 05:00:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696420835; x=1697025635; 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=TCSsB1yBxNop9ElFEQPzo8eRpaAPTBMtrtJV+7OJslM=; b=t4338tGYkiUc6DA3kdmPzoUcnvxTiagrrCHzwn4Jl2V3xLzOME4aasw+DmzOryX4ZL Z6AGUL8bGPWxf7IKMLk4Q7ClvH/CQwZ9WIHUCIpl7N8ePhdPMGzA8MWxOc5HJYnoZAnn UCtQhuyfpL/vkmr6QP4OS9357288pZ/hDOorJmP3/AZA8EEc7Uqq4F81NpevsrUalnSL 1Zl8acIb3Qqy5pXQwawdZ8cL/rSRrOfz0R0rj/RvP78BZ7/Xnu1YRlJk2AkelNVZLjHJ juUVdmFTwso9UNmlJD53ekzDT/ZZKsWWwvQAmPYUEHdO5cq4CEQkK6rpP9Fc/zJUcs3C MsMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696420835; x=1697025635; 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=TCSsB1yBxNop9ElFEQPzo8eRpaAPTBMtrtJV+7OJslM=; b=YGcgXAeicZwMF01lherRn221PuDE9aP+E/761W3RENZanHUk1rXQh9dIsuXai1+v0m sw1UkRfglHIc+cGQ0UOuwVS6fH7bCjpsOVGmDir+H/UcchItoTAnaizk+vbqPcapgtdI 64AY8BuUE9qwGZ0BgAYyu11LbqmIdfPByJV2UryYQ54ZV6LCahFDGXucjoTwS53JfZBb O/NO1CV4ffNaIt8ExWG4Ulrb1gYfrjXKnTsRvcsZWPvRkEjfzvlu+AGM1yGIE9wNdUqA cmUj7i+4zziV68gIcZdiq0CpXAa6lnURny4S4pZQ7RG9253ucbgfs/GncdrhEf0nhcss Zw9g== X-Gm-Message-State: AOJu0YwcsajUNz/Gct70kk9q86fOt6p68yung8zmj9x8HSZbJI3wH2cb uuw7GJXX8HYZPEwyuvl1TYteRRpfMj93IKuFKGE= X-Google-Smtp-Source: AGHT+IGK8aYCctUtCXrj5L0wSBym/N9vDYk5wPrTb/m2SCQX7FAR+R2IYm5MnEmO2FY+x7+HAEZs0w== X-Received: by 2002:a5d:6a4c:0:b0:31f:8a6d:e527 with SMTP id t12-20020a5d6a4c000000b0031f8a6de527mr1957218wrw.45.1696420834925; Wed, 04 Oct 2023 05:00:34 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Markus Armbruster , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , John Snow Subject: [PATCH v3 02/16] hw/ide/ahci: Clean up local variable shadowing Date: Wed, 4 Oct 2023 14:00:05 +0200 Message-ID: <20231004120019.93101-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231004120019.93101-1-philmd@linaro.org> References: <20231004120019.93101-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::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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1696420932392100004 Fix: hw/ide/ahci.c:1577:23: error: declaration shadows a local variable [-Werr= or,-Wshadow] IDEState *s =3D &ad->port.ifs[j]; ^ hw/ide/ahci.c:1569:29: note: previous declaration is here void ahci_uninit(AHCIState *s) ^ Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: John Snow Reviewed-by: Richard Henderson --- hw/ide/ahci.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c index d0a774bc17..fcc5476e9e 100644 --- a/hw/ide/ahci.c +++ b/hw/ide/ahci.c @@ -1622,9 +1622,7 @@ void ahci_uninit(AHCIState *s) AHCIDevice *ad =3D &s->dev[i]; =20 for (j =3D 0; j < 2; j++) { - IDEState *s =3D &ad->port.ifs[j]; - - ide_exit(s); + ide_exit(&ad->port.ifs[j]); } object_unparent(OBJECT(&ad->port)); } --=20 2.41.0 From nobody Wed May 15 16:42:07 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=1696421184; cv=none; d=zohomail.com; s=zohoarc; b=O1/vW7t0uk+fy53jWxAH8pmQidmJV+HejJF5/XPW4XuqYxZYrcTbLSPcCRTnjZuoFwB9iEHGak/WQ+TXGkh/wjAS8R+JsbLzNRFNu4ja+l+RnkOqVUycKjhENEtOqptJx+pI9NrC0Qpqfj1uuIXHUaYrnTTSsQaQ4iWvxxOQGtw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696421184; 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=KXIlmQvg0u+x76lQsbY8y6+C0hwUwSmaUkTgJ1Odfb4=; b=Ouelh+J1e6nMWrg7nHagNXeGbkMmPyk1eN5Y32uPTzSkS8dmEK4J6udlXVgdcKSkxw3bTlHWnhM/1ddaz1yrZ0zGlak0k/WH7vqxHkN8CBMfnpk/L1+msbV3LU0TXmWpiir3Qr1sJHpFSg6rMwcwU7a1aCmsn1eSpK8g6AKq5Mw= 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 1696421183988625.3330360864834; Wed, 4 Oct 2023 05:06:23 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qo0b1-0002RF-6K; Wed, 04 Oct 2023 08:03:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qo0YY-0008UT-Bp for qemu-devel@nongnu.org; Wed, 04 Oct 2023 08:00:51 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qo0YU-0000yE-Rc for qemu-devel@nongnu.org; Wed, 04 Oct 2023 08:00:44 -0400 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-406618d0991so19638665e9.2 for ; Wed, 04 Oct 2023 05:00:42 -0700 (PDT) Received: from m1x-phil.lan (5ep85-h01-176-173-163-52.dslam.bbox.fr. [176.173.163.52]) by smtp.gmail.com with ESMTPSA id 12-20020a05600c020c00b004063ea92492sm1347676wmi.22.2023.10.04.05.00.39 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Oct 2023 05:00:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696420841; x=1697025641; 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=KXIlmQvg0u+x76lQsbY8y6+C0hwUwSmaUkTgJ1Odfb4=; b=AF7y+p99+WGEvLf8n4F/yA3Zlbuyy7lkmnV/AhzHjNlaNXncO7Kx1nV88DnsynhAU3 Z/2KroKdd7DqqRjOYOJowRyzlnT9pmFqcJ2832QKaI0iWWASh5tV4sJmczGOwKPJErSd V7LaHbsWMu+XaXxjGflppYjFjRQt5i7zvWqGIikZ315LNF+87h020cFqe4lI9fOnM+K/ vQC3LJYB3XW46ijrg5LhBaslD4uxOAh9Mx45KDhmJwLBgzRzO9WzQ2Fi8bJWyUvNQsk6 t7/VvSYuyuteY51luE+8f4e8u27oo+rhQocKP7hMCgHPQCUoXSIxIIqOvYbFWHd4NCAy 2phA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696420841; x=1697025641; 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=KXIlmQvg0u+x76lQsbY8y6+C0hwUwSmaUkTgJ1Odfb4=; b=RPxe9Zw3H2ivHwctvWOYHy1GcM3/IddpN6yrDLlJDh9Wp2CYTxK4NWyHYT7rgF0kKw rjl0zytVWXUkJ/adeyd7iMzdGqL2VSTyp++alSZN5m07aR+XSTi/aPpYoIVvvvzyDZ5Y ptjJFJoSJtRvXJ/HWJeOV+33T31hDcGM1k6WwHQTu0M3puMH8aT7bqDAVU2dGi2WjMWC EM0/7vIChaGoz93ZPw/F9zqRJwtYjJpAMJkwHontIveSXBFlTdHIKrx9iu/bq83SHXpL ik3x+TaJb10zS+Rlb7nwpahN82He9zSsgO7JSO2GegzIPYWpxzZu9lJXsZ7bIvrQdkMQ SOQw== X-Gm-Message-State: AOJu0YzpZfeHGoj9cQjAdV89NlqvReu0FQruW9Y24FKjhTzDAc17Kxl5 uJCgjnHs3FWdXOjI9UgwkcWc1/2bW8r4UqFOZxU= X-Google-Smtp-Source: AGHT+IFNsc7RsFs0TW5sl9wYMTIux5+BkB0+d+QXbZoiiJaxpx7mFfddqeIAAfoCI2gQIbzuvMpbsw== X-Received: by 2002:a7b:ce89:0:b0:402:f07c:4b48 with SMTP id q9-20020a7bce89000000b00402f07c4b48mr2067131wmj.28.1696420841055; Wed, 04 Oct 2023 05:00:41 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Markus Armbruster , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Jason Wang Subject: [PATCH v3 03/16] net/net: Clean up global variable shadowing Date: Wed, 4 Oct 2023 14:00:06 +0200 Message-ID: <20231004120019.93101-4-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231004120019.93101-1-philmd@linaro.org> References: <20231004120019.93101-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::332; envelope-from=philmd@linaro.org; helo=mail-wm1-x332.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: 1696421185246100003 Fix: net/net.c:1680:35: error: declaration shadows a variable in the global sc= ope [-Werror,-Wshadow] bool netdev_is_modern(const char *optarg) ^ net/net.c:1714:38: error: declaration shadows a variable in the global sc= ope [-Werror,-Wshadow] void netdev_parse_modern(const char *optarg) ^ net/net.c:1728:60: error: declaration shadows a variable in the global sc= ope [-Werror,-Wshadow] void net_client_parse(QemuOptsList *opts_list, const char *optarg) ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/getopt.h:= 77:14: note: previous declaration is here extern char *optarg; /* getopt(3) external variables */ ^ Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Thomas Huth --- include/net/net.h | 6 +++--- net/net.c | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/include/net/net.h b/include/net/net.h index 330d285930..2fb1c9181c 100644 --- a/include/net/net.h +++ b/include/net/net.h @@ -247,9 +247,9 @@ extern const char *host_net_devices[]; =20 /* from net.c */ extern NetClientStateList net_clients; -bool netdev_is_modern(const char *optarg); -void netdev_parse_modern(const char *optarg); -void net_client_parse(QemuOptsList *opts_list, const char *str); +bool netdev_is_modern(const char *optstr); +void netdev_parse_modern(const char *optstr); +void net_client_parse(QemuOptsList *opts_list, const char *optstr); void show_netdevs(void); void net_init_clients(void); void net_check_clients(void); diff --git a/net/net.c b/net/net.c index 1c0bfdaa6c..c0c0cbe99e 100644 --- a/net/net.c +++ b/net/net.c @@ -1677,7 +1677,7 @@ void net_init_clients(void) * Modern syntax is to be parsed with netdev_parse_modern(). * Traditional syntax is to be parsed with net_client_parse(). */ -bool netdev_is_modern(const char *optarg) +bool netdev_is_modern(const char *optstr) { QemuOpts *opts; bool is_modern; @@ -1689,13 +1689,13 @@ bool netdev_is_modern(const char *optarg) .desc =3D { { } }, }; =20 - if (optarg[0] =3D=3D '{') { + if (optstr[0] =3D=3D '{') { /* This is JSON, which means it's modern syntax */ return true; } =20 opts =3D qemu_opts_create(&dummy_opts, NULL, false, &error_abort); - qemu_opts_do_parse(opts, optarg, dummy_opts.implied_opt_name, + qemu_opts_do_parse(opts, optstr, dummy_opts.implied_opt_name, &error_abort); type =3D qemu_opt_get(opts, "type"); is_modern =3D !g_strcmp0(type, "stream") || !g_strcmp0(type, "dgram"); @@ -1711,12 +1711,12 @@ bool netdev_is_modern(const char *optarg) * netdev_parse_modern() appends to @nd_queue, whereas net_client_parse() * appends to @qemu_netdev_opts. */ -void netdev_parse_modern(const char *optarg) +void netdev_parse_modern(const char *optstr) { Visitor *v; NetdevQueueEntry *nd; =20 - v =3D qobject_input_visitor_new_str(optarg, "type", &error_fatal); + v =3D qobject_input_visitor_new_str(optstr, "type", &error_fatal); nd =3D g_new(NetdevQueueEntry, 1); visit_type_Netdev(v, NULL, &nd->nd, &error_fatal); visit_free(v); @@ -1725,9 +1725,9 @@ void netdev_parse_modern(const char *optarg) QSIMPLEQ_INSERT_TAIL(&nd_queue, nd, entry); } =20 -void net_client_parse(QemuOptsList *opts_list, const char *optarg) +void net_client_parse(QemuOptsList *opts_list, const char *optstr) { - if (!qemu_opts_parse_noisily(opts_list, optarg, true)) { + if (!qemu_opts_parse_noisily(opts_list, optstr, true)) { exit(1); } } --=20 2.41.0 From nobody Wed May 15 16:42:07 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=1696421000; cv=none; d=zohomail.com; s=zohoarc; b=IjQyh7X6A1riijAc56WyfneVPRS00PvWUolhw/Kt2rCxyJyFF6HZeZw9W5Za5DIKWfVUqD8HupQOfNTtNqBVBhon2GxPBn24uuGWDvoKR67vz69BHHeLrRq671XlzT9MtUs+ymgISuj28+4Jsibtro7jj5QXLoq38kuAJHF5VWg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696421000; 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=f0GICmTJrrPt/1QlpCchvnQWSMZXbQVxu/WDlIYHaUw=; b=Owg2DVXblr09yCIBrosJ0OTC7rRTAmnCmQI3R0cvrFCxXYueZIpqEKZv3V5wWzWXgx9MYYVNwX17mLnccUJxZWu+R8IvRtIf3nmUHAZttgRy+2pBvmjrNUC09iWA0OuD9G3M5GNhCOuDdCLzHLdmLbxxaderJloEQPmE6nXjMUg= 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 1696421000040365.4247543027161; Wed, 4 Oct 2023 05:03:20 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qo0ao-0001Wx-31; Wed, 04 Oct 2023 08:03:06 -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 1qo0Yd-0008Um-Km for qemu-devel@nongnu.org; Wed, 04 Oct 2023 08:01:04 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qo0Yb-00010J-J5 for qemu-devel@nongnu.org; Wed, 04 Oct 2023 08:00:50 -0400 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-32487efc319so2025082f8f.1 for ; Wed, 04 Oct 2023 05:00:48 -0700 (PDT) Received: from m1x-phil.lan (5ep85-h01-176-173-163-52.dslam.bbox.fr. [176.173.163.52]) by smtp.gmail.com with ESMTPSA id q4-20020a5d5744000000b003231a0ca5ebsm3817200wrw.49.2023.10.04.05.00.45 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Oct 2023 05:00:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696420847; x=1697025647; 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=f0GICmTJrrPt/1QlpCchvnQWSMZXbQVxu/WDlIYHaUw=; b=nkBv0Brz1RN7FapVpWhzuWM8V6GSNfbuacwqPnZBgPvFQzLZa75lk6m47VIgbdN6lP 3j9XojSuwyCJoaRiaQJy4J6BLWtCT6QZ0ql2uKvhVRe/WCPV3S/GSXJWbY1JRnMlZdME QVnvq5dh9+MJub9SdfAl4fWN7+k6qFKZa+PuxiWweYBR7Z7ChNuVqCeyLwcjJshK5FbV 43ojjzFc7roXh9fb9WSeE8Y3aR3aH3AEtpOafLFMhdFhN7pV6Mcqe3GxOt/4yaTHpWjy KOn9MPDvpgfk1PaAgYjS9fZh1tnf+cs1drywL6qyCWcZ1wLcCix9oelOU5U/RsfVCfVe sNIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696420847; x=1697025647; 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=f0GICmTJrrPt/1QlpCchvnQWSMZXbQVxu/WDlIYHaUw=; b=Kkj09+6xuKK2a8F06JWSEQ/9Q9TozhM5tGv3KPLtLqH55jK7zhp1tCu1bWzBagV9NW fPelRoveaD2JLdqEln9iIDe0H1MCHtyj9uQ39oVkc59FUdDyWNm7RFK5xV/QJ5pZu3Yl 7rm8NS9v/h1eiHJS33y3dxWFepB3J1lzdFJHCJo0OQEZ7fj583v3TfWkkqNZEqeTDfWm o29J34QOr6soqx5Gmfmvr0hoHPoRmLg8P6Omr7HUMCgMh+3ppWD7d6nhVSlFPtLIt/SG 7IuaFNzl1Y1ccva5XccvMORY1+hjHov97QTbQmTw9Ucm6r6V+HBq916SU91VnE+DqrgE VTkQ== X-Gm-Message-State: AOJu0YwiOZVvAxmk0Y5OAhjlBL2AzVvRm7nUXyhnKm6Zdpq19cc3H3Fc sumE3oWBWn6CJ97M7MaReNcNEtOiCd9rbGPha1U= X-Google-Smtp-Source: AGHT+IHL2TIN4V+wokEd1/Sv4SaIhDM5Y9hsgAMKSI224mQSj1xFlgTYkUI5x2ZhZEzj5ShVR3VXqw== X-Received: by 2002:a5d:504e:0:b0:320:bbb:5ab1 with SMTP id h14-20020a5d504e000000b003200bbb5ab1mr1955791wrt.14.1696420846661; Wed, 04 Oct 2023 05:00:46 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Markus Armbruster , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini Subject: [PATCH v3 04/16] os-posix: Clean up global variable shadowing Date: Wed, 4 Oct 2023 14:00:07 +0200 Message-ID: <20231004120019.93101-5-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231004120019.93101-1-philmd@linaro.org> References: <20231004120019.93101-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::42a; envelope-from=philmd@linaro.org; helo=mail-wr1-x42a.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: 1696421000977100008 Fix: os-posix.c:103:31: error: declaration shadows a variable in the global sc= ope [-Werror,-Wshadow] bool os_set_runas(const char *optarg) ^ os-posix.c:176:32: error: declaration shadows a variable in the global sc= ope [-Werror,-Wshadow] void os_set_chroot(const char *optarg) ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/getopt.h:= 77:14: note: previous declaration is here extern char *optarg; /* getopt(3) external variables */ ^ Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Eric Blake Reviewed-by: Richard Henderson --- include/sysemu/os-posix.h | 4 ++-- os-posix.c | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/sysemu/os-posix.h b/include/sysemu/os-posix.h index 6dfdcbb086..dff32ae185 100644 --- a/include/sysemu/os-posix.h +++ b/include/sysemu/os-posix.h @@ -49,8 +49,8 @@ void os_setup_signal_handling(void); int os_set_daemonize(bool d); bool is_daemonized(void); void os_daemonize(void); -bool os_set_runas(const char *optarg); -void os_set_chroot(const char *optarg); +bool os_set_runas(const char *user_id); +void os_set_chroot(const char *path); void os_setup_post(void); int os_mlock(void); =20 diff --git a/os-posix.c b/os-posix.c index f90dfda9b0..52ef6990ff 100644 --- a/os-posix.c +++ b/os-posix.c @@ -94,13 +94,13 @@ static uid_t user_uid =3D (uid_t)-1; /* -1 -1 = >=3D0 */ static gid_t user_gid =3D (gid_t)-1; /* -1 -1 >=3D0 */ =20 /* - * Prepare to change user ID. optarg can be one of 3 forms: + * Prepare to change user ID. user_id can be one of 3 forms: * - a username, in which case user ID will be changed to its uid, * with primary and supplementary groups set up too; * - a numeric uid, in which case only the uid will be set; * - a pair of numeric uid:gid. */ -bool os_set_runas(const char *optarg) +bool os_set_runas(const char *user_id) { unsigned long lv; const char *ep; @@ -108,14 +108,14 @@ bool os_set_runas(const char *optarg) gid_t got_gid; int rc; =20 - user_pwd =3D getpwnam(optarg); + user_pwd =3D getpwnam(user_id); if (user_pwd) { user_uid =3D -1; user_gid =3D -1; return true; } =20 - rc =3D qemu_strtoul(optarg, &ep, 0, &lv); + rc =3D qemu_strtoul(user_id, &ep, 0, &lv); got_uid =3D lv; /* overflow here is ID in C99 */ if (rc || *ep !=3D ':' || got_uid !=3D lv || got_uid =3D=3D (uid_t)-1)= { return false; @@ -173,9 +173,9 @@ static void change_process_uid(void) =20 static const char *chroot_dir; =20 -void os_set_chroot(const char *optarg) +void os_set_chroot(const char *path) { - chroot_dir =3D optarg; + chroot_dir =3D path; } =20 static void change_root(void) --=20 2.41.0 From nobody Wed May 15 16:42:07 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=1696420999; cv=none; d=zohomail.com; s=zohoarc; b=aTN5aA7bud34VVlkwMoTv0VXa+39pwdaWM7lMClIphzUJxPDyyqMHMRqYY8VC7WOPy5a8j1UqWLsyyNRSMEN0P8U6POSPzCPGGJerV47aDO8MMz05EQ7CCgxHV3D/Aq73lnqJRFn3Ie9nE/p8P9Y7FNbJbc+jqzLP8CpJLFcpJY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696420999; 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=uFvZwDADzu+jGNLm/Nr1aEk3hDp0zJEDlovZc+F59xM=; b=nxCpFv6mctIvdSgjioPcxOVNhDEHmqU5i8eXMimkD03lsJU4UxRI+29u5K7lv/687LzrRIOL7+YHFty/mxADPg3HUFGfjDj2xFnejpnoM+PzLkG2kOmhzuwUvwnGW7oMSSxwi3Jbm/Xf+UAWCWFZVfnf6RgVbg8JrYPYpR0Sq9o= 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 1696420999088326.2067609823554; Wed, 4 Oct 2023 05:03:19 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qo0ak-00017l-LQ; Wed, 04 Oct 2023 08:03:02 -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 1qo0Yj-00006h-HD for qemu-devel@nongnu.org; Wed, 04 Oct 2023 08:01:04 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qo0Yg-00010z-Ly for qemu-devel@nongnu.org; Wed, 04 Oct 2023 08:00:56 -0400 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-4060b623e64so5255015e9.0 for ; Wed, 04 Oct 2023 05:00:54 -0700 (PDT) Received: from m1x-phil.lan (5ep85-h01-176-173-163-52.dslam.bbox.fr. [176.173.163.52]) by smtp.gmail.com with ESMTPSA id g18-20020a5d5552000000b0032327b70ef6sm3865780wrw.70.2023.10.04.05.00.51 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Oct 2023 05:00:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696420852; x=1697025652; 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=uFvZwDADzu+jGNLm/Nr1aEk3hDp0zJEDlovZc+F59xM=; b=CfIHqfe+XO5A2GWTasaHgTBZyPjmjz8EgE8LP0hzssONqBmBthiob8V7ji9e39nq87 7mWt7uT+jnyuxCoi4JAq6DNiZhMQMGWoJDG++EkBDPLNoFVmmhq1yw+qNokILVFsIFXe OrUDlNrk98YbHAfenEahhZJKaz/L0b/YIlD78zWQI3XF/cew7GxMYJP7hjl7mzOKQt0x de/v+4wf8j1D/lpT6LNz3Oyo0Jn+1bye1zoJecZvO6pgtlv4426akFd0vzlCBqQ8bUz9 882BEit66qtEYZZ/jrDIuOKYlIfFNvoyRKlJcv0IweKacFb+MJMhwLh2ws1mAopEY/GL Gk1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696420852; x=1697025652; 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=uFvZwDADzu+jGNLm/Nr1aEk3hDp0zJEDlovZc+F59xM=; b=l0U/s1O4ZbX1m4MAyEi9+vrTdMqCS1kS2aF4XkEhdbgoFbu8n//nbgl86N1S+tgdNK AaPfQTgTHxVBw788bEi1G36ySouolAq2Ouk8Jh+od+sFdYQpe/5/vWHlgU6z79eHsKKK fpgRtMxzJpdzhvSz6N+PyHFMUUoZR+sKkosbfqJbafnCT0ydwumK1fo7KUxtO2qZpH0P Gb/AYAciNPcKrQsPH/yjlDAb6NdB0ZQ9CfGtsAKEvcACYwEe2XlEThIJl/65ZwMsI+xI dRpOdQlR42v8DCknpkuLpBwMeTyNRy3V68D9Cbs4y1KmvQbLob0KUGDi9ea+JRgVWoMc Ny5g== X-Gm-Message-State: AOJu0YxK8IsvBhzkqCQYgOlJvuNC06rEL2ZHOakPEiQn0Fogsq4jvI7q 9w1PU1xYHrZNXTu4PMaEIqA2AVyd6b3xVQklMCA= X-Google-Smtp-Source: AGHT+IEXIZTrg1qnQx3RubWF1mReyHjUCnbWwh/8W+VVNuAwgCBCuyd7CivVVgalmM/M6alD0O8fdA== X-Received: by 2002:a05:600c:3b11:b0:406:45c1:4dd with SMTP id m17-20020a05600c3b1100b0040645c104ddmr4664556wms.14.1696420852705; Wed, 04 Oct 2023 05:00:52 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Markus Armbruster , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Alexandre Iooss , Mahmoud Mandour Subject: [PATCH v3 05/16] plugins/loader: Clean up global variable shadowing Date: Wed, 4 Oct 2023 14:00:08 +0200 Message-ID: <20231004120019.93101-6-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231004120019.93101-1-philmd@linaro.org> References: <20231004120019.93101-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::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.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: 1696421000973100007 Fix: include/qemu/plugin.h:245:54: error: declaration shadows a variable in th= e global scope [-Werror,-Wshadow] static inline void qemu_plugin_opt_parse(const char *optarg, ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/getopt.h:= 77:14: note: previous declaration is here extern char *optarg; /* getopt(3) external variables */ ^ Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Alex Benn=C3=A9e Reviewed-by: Richard Henderson --- include/qemu/plugin.h | 4 ++-- plugins/loader.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/qemu/plugin.h b/include/qemu/plugin.h index bc0781cab8..7fdc3a4849 100644 --- a/include/qemu/plugin.h +++ b/include/qemu/plugin.h @@ -50,7 +50,7 @@ static inline void qemu_plugin_add_opts(void) qemu_add_opts(&qemu_plugin_opts); } =20 -void qemu_plugin_opt_parse(const char *optarg, QemuPluginList *head); +void qemu_plugin_opt_parse(const char *optstr, QemuPluginList *head); int qemu_plugin_load_list(QemuPluginList *head, Error **errp); =20 union qemu_plugin_cb_sig { @@ -242,7 +242,7 @@ void qemu_plugin_user_postfork(bool is_child); static inline void qemu_plugin_add_opts(void) { } =20 -static inline void qemu_plugin_opt_parse(const char *optarg, +static inline void qemu_plugin_opt_parse(const char *optstr, QemuPluginList *head) { error_report("plugin interface not enabled in this build"); diff --git a/plugins/loader.c b/plugins/loader.c index 809f3f9b13..734c11cae0 100644 --- a/plugins/loader.c +++ b/plugins/loader.c @@ -140,12 +140,12 @@ static int plugin_add(void *opaque, const char *name,= const char *value, return 0; } =20 -void qemu_plugin_opt_parse(const char *optarg, QemuPluginList *head) +void qemu_plugin_opt_parse(const char *optstr, QemuPluginList *head) { struct qemu_plugin_parse_arg arg; QemuOpts *opts; =20 - opts =3D qemu_opts_parse_noisily(qemu_find_opts("plugin"), optarg, tru= e); + opts =3D qemu_opts_parse_noisily(qemu_find_opts("plugin"), optstr, tru= e); if (opts =3D=3D NULL) { exit(1); } --=20 2.41.0 From nobody Wed May 15 16:42:07 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=1696421061; cv=none; d=zohomail.com; s=zohoarc; b=g9W+gClORYshtf5YcThw/lyNiqcGMRqbWicAmN2mhHv10KQTomCly+MmuqgogTC2IaCXDYNkPwxN9wcCfeyIp0zCU11uoxlACY1e5m0Yqkbnyxf9dnGgk8ELbHos0/qY6+OUDnSUjmcdsjUT/k1HD1D9ySmoSXOQ59GbBISOzv0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696421061; 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=DZOn2Cyb3kswX+CAOC8A0GBq7vdEIRLvrDWoI8N+PSM=; b=hiADzp+DjlfNjFiYLHEGrXKmPiNY8c5+07BaSqq3K17RIwJh1jpjBQO4vp8LF+P/DcOQ0s2AsvvF25empHJNkRJihVBJIZ61cqdkST22pY4gDq4+tkaqIwg5uqX75fR6FAfnimLuxT9kkCuc6iiimMiuky3229738+qrG0+qT+4= 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 1696421061120197.50649527562337; Wed, 4 Oct 2023 05:04:21 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qo0b5-0002nh-3D; Wed, 04 Oct 2023 08:03:23 -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 1qo0Yv-000092-0u for qemu-devel@nongnu.org; Wed, 04 Oct 2023 08:01:18 -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 1qo0Yq-00011W-BD for qemu-devel@nongnu.org; Wed, 04 Oct 2023 08:01:08 -0400 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-40651a726acso19299245e9.1 for ; Wed, 04 Oct 2023 05:01:00 -0700 (PDT) Received: from m1x-phil.lan (5ep85-h01-176-173-163-52.dslam.bbox.fr. [176.173.163.52]) by smtp.gmail.com with ESMTPSA id y11-20020a05600c364b00b004063977eccesm1346353wmq.42.2023.10.04.05.00.56 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Oct 2023 05:00:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696420859; x=1697025659; 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=DZOn2Cyb3kswX+CAOC8A0GBq7vdEIRLvrDWoI8N+PSM=; b=t3mZf4PtJVLMY4/kl0HRxnfPOoBa9YnDkkb9yvlyyduFx6EFr6I727reDsUeEsuo6h y/2Wg/mx+ccf3R0ayfVo1lrJf9cxtChYQ+iOPvBPNYNDAah9dvaQ8xdk58Z3qc0SG6PE z9lAMtQjPfGTz56HEGV4AE9CtMtllbNnP2xKvLhIIU+3mOIpK/o7mDSuJ5sllcVXyBPb 1+IIEHsm3OFbUvHUz4Bay98PexVcRbC4d3bKNF3NDgGl4NVxAyxhvSnv4AfpKpS6WXf9 6PPGYA3upfHf9m/0sAXGgyd+r8/pOujs49YwKflOyLA9b3YGwBaqz4RU+ACmjoDfJ7E8 cI3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696420859; x=1697025659; 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=DZOn2Cyb3kswX+CAOC8A0GBq7vdEIRLvrDWoI8N+PSM=; b=aPss3uRHuCduajEXU/t0Dd7SrVZjfK3WKN1bGGVVAYV9KXfWpe9d9tcZ+pRTbnyhgd HPNKM9Ab3k4Gmztw6T2RwO85g9ULAh0cN20pIRonmWI6Qp+gh+nhrm8jGOR9iVKAECJC JbYxe8p11lN/DCYMrkM6O5uLr5UBmtqc4j3o+gH0odTrRoTE/fULqh5tUF59/CI+ex4Y vPmqyw4wQNfmHO6GXcUko2wzO8sLG13zDFbeQdRZ7oqaUkViHBBeYvGDnlNQnSEBGuHg YwAS+1n34pBSrz33390pZ1BbQpRxSLSTpMo4yll8ISu16KYqg3WY7/PU/gVGU19hinb/ 3iWg== X-Gm-Message-State: AOJu0YxeYrKZA9H7hDaiycPtw3kEMurm/xqmhc+Kfwu9CFpdxrDSlY7s RWPxYMFHQaEFazJev3/x6yGkT8cKO8Mpfa5sLf4= X-Google-Smtp-Source: AGHT+IEeZMe+THQCTIWqRpKf2iDMGPxGxlm3EB5Lukifxoa7+fPWeRy/68FE34HyipEy5zM8UcrGQg== X-Received: by 2002:a1c:7710:0:b0:405:3ee3:c69c with SMTP id t16-20020a1c7710000000b004053ee3c69cmr2222087wmi.15.1696420858586; Wed, 04 Oct 2023 05:00:58 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Markus Armbruster , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Kevin Wolf , Hanna Reitz Subject: [PATCH v3 06/16] qemu-img: Clean up global variable shadowing Date: Wed, 4 Oct 2023 14:00:09 +0200 Message-ID: <20231004120019.93101-7-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231004120019.93101-1-philmd@linaro.org> References: <20231004120019.93101-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::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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1696421062438100001 Fix: qemu-img.c:247:46: error: declaration shadows a variable in the global sc= ope [-Werror,-Wshadow] static bool is_valid_option_list(const char *optarg) ^ qemu-img.c:265:53: error: declaration shadows a variable in the global sc= ope [-Werror,-Wshadow] static int accumulate_options(char **options, char *optarg) ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/getopt.h:= 77:14: note: previous declaration is here extern char *optarg; /* getopt(3) external variables */ ^ Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Eric Blake Reviewed-by: Richard Henderson --- qemu-img.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index a48edb7101..6068ab0d27 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -235,25 +235,25 @@ void help(void) } =20 /* - * Is @optarg safe for accumulate_options()? + * Is @list safe for accumulate_options()? * It is when multiple of them can be joined together separated by ','. - * To make that work, @optarg must not start with ',' (or else a + * To make that work, @list must not start with ',' (or else a * separating ',' preceding it gets escaped), and it must not end with * an odd number of ',' (or else a separating ',' following it gets * escaped), or be empty (or else a separating ',' preceding it can * escape a separating ',' following it). *=20 */ -static bool is_valid_option_list(const char *optarg) +static bool is_valid_option_list(const char *list) { - size_t len =3D strlen(optarg); + size_t len =3D strlen(list); size_t i; =20 - if (!optarg[0] || optarg[0] =3D=3D ',') { + if (!list[0] || list[0] =3D=3D ',') { return false; } =20 - for (i =3D len; i > 0 && optarg[i - 1] =3D=3D ','; i--) { + for (i =3D len; i > 0 && list[i - 1] =3D=3D ','; i--) { } if ((len - i) % 2) { return false; @@ -262,19 +262,19 @@ static bool is_valid_option_list(const char *optarg) return true; } =20 -static int accumulate_options(char **options, char *optarg) +static int accumulate_options(char **options, char *list) { char *new_options; =20 - if (!is_valid_option_list(optarg)) { - error_report("Invalid option list: %s", optarg); + if (!is_valid_option_list(list)) { + error_report("Invalid option list: %s", list); return -1; } =20 if (!*options) { - *options =3D g_strdup(optarg); + *options =3D g_strdup(list); } else { - new_options =3D g_strdup_printf("%s,%s", *options, optarg); + new_options =3D g_strdup_printf("%s,%s", *options, list); g_free(*options); *options =3D new_options; } --=20 2.41.0 From nobody Wed May 15 16:42:07 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=1696421009; cv=none; d=zohomail.com; s=zohoarc; b=GgO7lX/xvwkaM1Aa1BA/1uCYoC8hJ8PPQN9zWB8xSb0ZDaz6ENHx5rSDh+NluN1o5aP4xZk5S50pNsNHVsBQXqD1jvBs7JoODOwi3nChh2nudcOUfxOnqK31BF9DnzJAmLhlZvJVvTCFGQC9H8ssTwpfuYYpz9TX1FJpNOqUlbo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696421009; 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=6gKDMfa7dSai1h/sgemtp7pr068K3EYlzpE9zbZdHuU=; b=eO2iRxYx3LYIMHf/pahRIcsGAlrEcbAwFxPuV/tqkrkhaAnK7AhrAdPfhZRqySwFdDztcw9724mPLflEkZozuIgDnudN/o7+XvfmSthG5M2UuSZQlBBaTLECn5wGkVGtndfiCa8sapao8cl7/pRYxOyRLNUjswQvtnAMWUOXs9o= 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 1696421009151108.22633069124254; Wed, 4 Oct 2023 05:03:29 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qo0as-0001uI-7d; Wed, 04 Oct 2023 08:03:11 -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 1qo0ZC-0000Jz-66 for qemu-devel@nongnu.org; Wed, 04 Oct 2023 08:01:33 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qo0Ys-00012m-KC for qemu-devel@nongnu.org; Wed, 04 Oct 2023 08:01:24 -0400 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-406609df1a6so20681565e9.3 for ; Wed, 04 Oct 2023 05:01:06 -0700 (PDT) Received: from m1x-phil.lan (5ep85-h01-176-173-163-52.dslam.bbox.fr. [176.173.163.52]) by smtp.gmail.com with ESMTPSA id r2-20020a05600c320200b0040641ce36a8sm1453822wmp.1.2023.10.04.05.01.03 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Oct 2023 05:01:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696420865; x=1697025665; 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=6gKDMfa7dSai1h/sgemtp7pr068K3EYlzpE9zbZdHuU=; b=mo8FY6sUjvXEI+5WT3rHqjr27ipxS/Lyohoh/ucQp3aePWMB+9BoVReAoao4i2Frc6 LyZyWBNxTNZXo1+VBNMyXCOHbc/3d1dAwm4s7CoRB0ljYLUpjXKfdGQu6fWZpeoIBT9R XN9+I85rlIbjUFdn2mH+HTDCxwWGiD8Tv+ea9WhFejOHtCcnNxzyFr/TGAgFCdWsELP/ NRcp19LHyAlJ7zncwyQ8xDUFhlxpkr0y+Of1xiEtRqfCnPTXi+eK0X7lQqFUCsp/XN+V 6UIpJYpH8JAg6phGVm2EFxazHWGyvhvONyynIBC9f1PuzAaPB4XmdKf36D4a6NmZFpKA MszQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696420865; x=1697025665; 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=6gKDMfa7dSai1h/sgemtp7pr068K3EYlzpE9zbZdHuU=; b=UtsvYD0QpP9yT68iUVUAkI8fFtC1v7MXD7xRIDAOsxavpCH658pXaJxfwySzyXlydN 7FcuD7MOHf28HGxD6lFGYvL3G5rGe04yLr2hutstPmArgZTv7iFU07OOBgIeRJND8H4k LxRJd1C70mDMy3ivKK9VHM5/pp1r+FT90j9lQBi0rtTZ1Lc5+R9Rs9HxJfXAl2w0PjOF ywVwgC72kgJAsLQWKy5PwEcR4XTxDxo86LCLYcgYezhw08kTGueHu3LxsgsryAUDEoiJ 3FD8BBD7FvKunoQ9qD84C62BAokmtDy3L69hNzbEcbeIqj+6bbbyjZKMgDehvcrL3dSi y1/Q== X-Gm-Message-State: AOJu0Yz5K1kBeYo8wm++eADLV99XxNIVniYLrtEv6rqYeZnlT661U7MN BcdICeckHpbo2L5Kf737fbZThmzvPdNUG53d4o8= X-Google-Smtp-Source: AGHT+IEPMlqsQ/w4grTD1Hcrw0TJCSty32loqCY8HwMPahqXshgVyQ/9ugHvWlZjOKchvkAn8xPV1Q== X-Received: by 2002:a05:600c:2287:b0:400:57d1:4911 with SMTP id 7-20020a05600c228700b0040057d14911mr2041971wmf.16.1696420864999; Wed, 04 Oct 2023 05:01:04 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Markus Armbruster , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Kevin Wolf , Hanna Reitz Subject: [PATCH v3 07/16] qemu-io: Clean up global variable shadowing Date: Wed, 4 Oct 2023 14:00:10 +0200 Message-ID: <20231004120019.93101-8-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231004120019.93101-1-philmd@linaro.org> References: <20231004120019.93101-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::331; envelope-from=philmd@linaro.org; helo=mail-wm1-x331.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, T_SPF_TEMPERROR=0.01 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: 1696421011183100003 Fix: qemu-io.c:478:36: error: declaration shadows a variable in the global sco= pe [-Werror,-Wshadow] static void add_user_command(char *optarg) ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/getopt.h:= 77:14: note: previous declaration is here extern char *optarg; /* getopt(3) external variables */ ^ Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Eric Blake Reviewed-by: Richard Henderson --- qemu-io.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qemu-io.c b/qemu-io.c index 2bd7bfb650..050c70835f 100644 --- a/qemu-io.c +++ b/qemu-io.c @@ -475,10 +475,10 @@ static int command_loop(void) return last_error; } =20 -static void add_user_command(char *optarg) +static void add_user_command(char *user_cmd) { cmdline =3D g_renew(char *, cmdline, ++ncmdline); - cmdline[ncmdline-1] =3D optarg; + cmdline[ncmdline - 1] =3D user_cmd; } =20 static void reenable_tty_echo(void) --=20 2.41.0 From nobody Wed May 15 16:42:07 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=1696421000; cv=none; d=zohomail.com; s=zohoarc; b=dMHOt3fiKBVyWqS6v7vxF9ceh8QajeLeZcK26shXU11tcFtP0lxF23ubEFFk5in537WRn0OLJmKs1b4r+elByVJHfGokuIk6xjsvAvqET6dHpEt/z+N5nPU2JkwGXxjrBfFDqDfkdJVSNb44GrSk1Oxsnng6U1ddS5qRuUKmKHI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696421000; 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=dSsZst+VBCRAXvBcctI1DdSiyNeof1zy8WHkK6DbNv0=; b=Q56SwKYVyp95iWtBae/b3+TBnG+KBNDvLYo8Co96NcdfSk1lDqcYZ3teurUsjrkSmXvecGWEj17NiA6k9wc7tbWsTe4bk77HJqYtpAJz78q/GmRa6Mji4Nbbzr1VamMiLUg10ST4Pug1PhD2Txf6U5KzpUNF0j5EWW6Jl+Iy14I= 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 1696421000190128.98517198934178; Wed, 4 Oct 2023 05:03:20 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qo0ao-0001bo-9i; Wed, 04 Oct 2023 08:03:06 -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 1qo0Z3-0000Bc-3r for qemu-devel@nongnu.org; Wed, 04 Oct 2023 08:01:18 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qo0Yz-00013c-Sc for qemu-devel@nongnu.org; Wed, 04 Oct 2023 08:01:16 -0400 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-3248aa5cf4eso2042319f8f.1 for ; Wed, 04 Oct 2023 05:01:13 -0700 (PDT) Received: from m1x-phil.lan (5ep85-h01-176-173-163-52.dslam.bbox.fr. [176.173.163.52]) by smtp.gmail.com with ESMTPSA id g9-20020a5d46c9000000b0031ae8d86af4sm3862502wrs.103.2023.10.04.05.01.09 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Oct 2023 05:01:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696420871; x=1697025671; 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=dSsZst+VBCRAXvBcctI1DdSiyNeof1zy8WHkK6DbNv0=; b=W0kQUSP1RninGVGh1C8T+Fwdvu2rCnhH+0hNPfhUmPibqFtxidGxr/Jeph40GIvMyt g9pXYI3VpIA0k9ST6Y/jj8bg2LTqO7zldlZib+LvhAZ0aco+gxdgxnzmSmqLmBjXp1PJ 5+agjujZaO3xFPsoii+aDwxcxCyjQecvG2TDJwcgB/jkuze7+/c0QpDNWa2nY0MTveP4 0FQL/pisxGYC2wYMoRs8QzX5BGTEeavyydyAR/CrvsMrXDOUF9p3JSud7mfKB7pg1n8H U2hc0UZnRgVx/ebK1pR5dpLdhe/0w+Y2ApHrVmpqxB7vm1HyzS/gAKCu3LlPHcK6ZMJ+ Ydlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696420871; x=1697025671; 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=dSsZst+VBCRAXvBcctI1DdSiyNeof1zy8WHkK6DbNv0=; b=HYn9/N3lCE3JeM38F8YB9AH/ImeJHfCzl1zgmFruGzaM0+aTOv2qaSFTj0jcHGRPwG AS87OCv0hiMR8J3NiPVUzlJLsOOiYxbgJxE/3gUlMHb4vHJy28eMJG4UEZ4afmoPF7lP E5/51+m7cEsQxelzlY+3iw6wl2gmsBUvtBGs0XMIMEqBNHnnxsoSVkRz1noIYl94vo8+ 8t0jbEMs+lZ9TYBCBkSYG3tDoEWmL5wX57SWcqzKelAyqCaOpmMK5Sd4hStOPmnHRrAA 31XmZnJ2cThJ0+gZJFfu2uuwU/JtmkZRgyIUioJ5AJNef0TZMlXxSOH8aWfgFT0EoemX P67g== X-Gm-Message-State: AOJu0YyLFL+tcGP+SCDCVQOwidpTOjWbqP+EOQRE8/hvzhQ4c1vLMNtZ m03VGc42aVxtGFxA9Mv82pGWBO/YIz5hmwNKKQc= X-Google-Smtp-Source: AGHT+IFHnxfX0hdWAcNtmdBKTKDUyXwbxoBSvzl69Kgnya+2rYyG3gXbTthq1ZYiYEo8Yr1N+CbJug== X-Received: by 2002:a5d:6091:0:b0:317:5747:b955 with SMTP id w17-20020a5d6091000000b003175747b955mr1630470wrt.17.1696420870820; Wed, 04 Oct 2023 05:01:10 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Markus Armbruster , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost Subject: [PATCH v3 08/16] qom/object_interfaces: Clean up global variable shadowing Date: Wed, 4 Oct 2023 14:00:11 +0200 Message-ID: <20231004120019.93101-9-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231004120019.93101-1-philmd@linaro.org> References: <20231004120019.93101-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::42c; envelope-from=philmd@linaro.org; helo=mail-wr1-x42c.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: 1696421001122100011 Fix: qom/object_interfaces.c:262:53: error: declaration shadows a variable in = the global scope [-Werror,-Wshadow] ObjectOptions *user_creatable_parse_str(const char *optarg, Error **errp) ^ qom/object_interfaces.c:298:46: error: declaration shadows a variable in = the global scope [-Werror,-Wshadow] bool user_creatable_add_from_str(const char *optarg, Error **errp) ^ qom/object_interfaces.c:313:49: error: declaration shadows a variable in = the global scope [-Werror,-Wshadow] void user_creatable_process_cmdline(const char *optarg) ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/getopt.h:= 77:14: note: previous declaration is here extern char *optarg; /* getopt(3) external variables */ ^ Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- include/qom/object_interfaces.h | 16 ++++++++-------- qom/object_interfaces.c | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/include/qom/object_interfaces.h b/include/qom/object_interface= s.h index 81541e2080..02b11a7ef0 100644 --- a/include/qom/object_interfaces.h +++ b/include/qom/object_interfaces.h @@ -99,7 +99,7 @@ void user_creatable_add_qapi(ObjectOptions *options, Erro= r **errp); =20 /** * user_creatable_parse_str: - * @optarg: the object definition string as passed on the command line + * @str: the object definition string as passed on the command line * @errp: if an error occurs, a pointer to an area to store the error * * Parses the option for the user creatable object with a keyval parser and @@ -110,14 +110,14 @@ void user_creatable_add_qapi(ObjectOptions *options, = Error **errp); * Returns: ObjectOptions on success, NULL when an error occurred (*errp i= s set * then) or help was printed (*errp is not set). */ -ObjectOptions *user_creatable_parse_str(const char *optarg, Error **errp); +ObjectOptions *user_creatable_parse_str(const char *str, Error **errp); =20 /** * user_creatable_add_from_str: - * @optarg: the object definition string as passed on the command line + * @str: the object definition string as passed on the command line * @errp: if an error occurs, a pointer to an area to store the error * - * Create an instance of the user creatable object by parsing optarg + * Create an instance of the user creatable object by parsing @str * with a keyval parser and implicit key 'qom-type', converting the * result to ObjectOptions and calling into qmp_object_add(). * @@ -126,13 +126,13 @@ ObjectOptions *user_creatable_parse_str(const char *o= ptarg, Error **errp); * Returns: true when an object was successfully created, false when an er= ror * occurred (*errp is set then) or help was printed (*errp is not set). */ -bool user_creatable_add_from_str(const char *optarg, Error **errp); +bool user_creatable_add_from_str(const char *str, Error **errp); =20 /** * user_creatable_process_cmdline: - * @optarg: the object definition string as passed on the command line + * @cmdline: the object definition string as passed on the command line * - * Create an instance of the user creatable object by parsing optarg + * Create an instance of the user creatable object by parsing @cmdline * with a keyval parser and implicit key 'qom-type', converting the * result to ObjectOptions and calling into qmp_object_add(). * @@ -141,7 +141,7 @@ bool user_creatable_add_from_str(const char *optarg, Er= ror **errp); * This function is only meant to be called during command line parsing. * It exits the process on failure or after printing help. */ -void user_creatable_process_cmdline(const char *optarg); +void user_creatable_process_cmdline(const char *cmdline); =20 /** * user_creatable_print_help: diff --git a/qom/object_interfaces.c b/qom/object_interfaces.c index 7d31589b04..e0833c8bfe 100644 --- a/qom/object_interfaces.c +++ b/qom/object_interfaces.c @@ -259,7 +259,7 @@ static void user_creatable_print_help_from_qdict(QDict = *args) } } =20 -ObjectOptions *user_creatable_parse_str(const char *optarg, Error **errp) +ObjectOptions *user_creatable_parse_str(const char *str, Error **errp) { ERRP_GUARD(); QObject *obj; @@ -267,14 +267,14 @@ ObjectOptions *user_creatable_parse_str(const char *o= ptarg, Error **errp) Visitor *v; ObjectOptions *options; =20 - if (optarg[0] =3D=3D '{') { - obj =3D qobject_from_json(optarg, errp); + if (str[0] =3D=3D '{') { + obj =3D qobject_from_json(str, errp); if (!obj) { return NULL; } v =3D qobject_input_visitor_new(obj); } else { - QDict *args =3D keyval_parse(optarg, "qom-type", &help, errp); + QDict *args =3D keyval_parse(str, "qom-type", &help, errp); if (*errp) { return NULL; } @@ -295,12 +295,12 @@ ObjectOptions *user_creatable_parse_str(const char *o= ptarg, Error **errp) return options; } =20 -bool user_creatable_add_from_str(const char *optarg, Error **errp) +bool user_creatable_add_from_str(const char *str, Error **errp) { ERRP_GUARD(); ObjectOptions *options; =20 - options =3D user_creatable_parse_str(optarg, errp); + options =3D user_creatable_parse_str(str, errp); if (!options) { return false; } @@ -310,9 +310,9 @@ bool user_creatable_add_from_str(const char *optarg, Er= ror **errp) return !*errp; } =20 -void user_creatable_process_cmdline(const char *optarg) +void user_creatable_process_cmdline(const char *cmdline) { - if (!user_creatable_add_from_str(optarg, &error_fatal)) { + if (!user_creatable_add_from_str(cmdline, &error_fatal)) { /* Help was printed */ exit(EXIT_SUCCESS); } --=20 2.41.0 From nobody Wed May 15 16:42:07 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=1696421034; cv=none; d=zohomail.com; s=zohoarc; b=ZyYuTz1NlGmzaZHtqZbHR9f0V54dCyemZ3rjFnGMFzrWTmlpPKm8onEwyqHZPR09mXs4jNOY46nkM8C30HHbuzbfpPIx2PB1CGatgKsZ5YsX+vU+Sxt+PuAPtHdqtlWSgxy2F+thKDkIz58QpL4jwucXxKY9Ll7b+6BatAkYvb4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696421034; 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=lY+2ZyI4HgMHia8dRE1/FWk+2Dlndzg7wEwrT1ttBuw=; b=TXZSdn50eBkq/sxSaApioFgzzSjt1yts63oITjJ3wF/a8IigmUFTSVGsAmZvNtTlu3mRTxRKqsnUjGhKJXwGXzxKzUauwmFVcL1Ro2/VDF6JJybyoOmueHe9RD5/n8f8bzIyodqQBvke9cLaQWVoVmcQjGt2jHXIYQCyHRXuYts= 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 1696421034160802.8851914266272; Wed, 4 Oct 2023 05:03:54 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qo0at-0001zY-6S; Wed, 04 Oct 2023 08:03:11 -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 1qo0ZB-0000Jm-6M for qemu-devel@nongnu.org; Wed, 04 Oct 2023 08:01:33 -0400 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qo0Z6-00014p-0z for qemu-devel@nongnu.org; Wed, 04 Oct 2023 08:01:22 -0400 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-405524e6768so19833055e9.2 for ; Wed, 04 Oct 2023 05:01:19 -0700 (PDT) Received: from m1x-phil.lan (5ep85-h01-176-173-163-52.dslam.bbox.fr. [176.173.163.52]) by smtp.gmail.com with ESMTPSA id p7-20020adff207000000b003253523d767sm3837501wro.109.2023.10.04.05.01.15 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Oct 2023 05:01:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696420878; x=1697025678; 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=lY+2ZyI4HgMHia8dRE1/FWk+2Dlndzg7wEwrT1ttBuw=; b=F2pYlKQC3xDPyDiLtmHNVWaEZwc5AWU+LZ/eMDfFDYEW//WQ2hUjKjfwfJBVfQn4wv 1jN/RYdJm4XQl102pFlZyhyWFSrR8I7naZn5HHhIXZZc3t3cODSvHRXD47Kdd1/OKofx 42bqVOBIMzruclo4sZcnA6vHITQldTbYQkKGLvap7E55wO9JAle6F38nQ/Mye+qxWEOb RdUyxRia1wf0JMAmSkFwZ/159ZFYbmQfeegVm84dR8X3a1ps1sjedW+WW8I3XoKi17e3 lVQ98P19Xw8RGbcJqUuQifAqToA5cf8JT8qvWcfmSdx8fsT3sLN8CVx4QVe+ol444MUN 2Atg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696420878; x=1697025678; 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=lY+2ZyI4HgMHia8dRE1/FWk+2Dlndzg7wEwrT1ttBuw=; b=JxJ7XF8Tcw6k1HSEGYGkgTBx1cfUoROKzdj5/XTO5t61a45H6VrwpUnQ/CH3s6gSW5 Z+YEW8P9vURjW5TELCP5NxJF9eyLB7g2oy1QlpxchlgvVYq6LWmTFPzVLBCu8+U95bzO JSX7n5fBjBVqSJIeILyP3zknrhXDQR5shVNQt87e5prMO6WNcckuFaLKct+K4tXNV3hY 6du8rvClpoX2E96AmUeVNLTywdaMAFm5xqcOXq2yPl1+g+OrUOPBKCtXOHB7NuHZlN8P CGo0dWFO1gt+7k9QPmTldTnNZTlIzSixCcnAlkVOzUg16wq1VfCmvCemXFrI1dIbvTU/ M8iw== X-Gm-Message-State: AOJu0Yw/WeUwkyFnipJGZNC5zJyT+qKpwQSRHfQiT8MN8mNCMQ69Bt5c RkHokpMthk+QM3gACLEUrcYVTvU3L/CFZ0HkBYY= X-Google-Smtp-Source: AGHT+IHpz3K5Hghl3u2dyVG1oPT1csZBgDcX7TcKpIiSBonBl/oFwdDqCGuTb7525lFrO98JTQeClg== X-Received: by 2002:a05:600c:6027:b0:406:8465:d299 with SMTP id az39-20020a05600c602700b004068465d299mr1518248wmb.7.1696420876973; Wed, 04 Oct 2023 05:01:16 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Markus Armbruster , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Paolo Bonzini Subject: [PATCH v3 09/16] semihosting: Clean up global variable shadowing Date: Wed, 4 Oct 2023 14:00:12 +0200 Message-ID: <20231004120019.93101-10-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231004120019.93101-1-philmd@linaro.org> References: <20231004120019.93101-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::330; envelope-from=philmd@linaro.org; helo=mail-wm1-x330.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: 1696421035824100003 Fix: semihosting/config.c:134:49: error: declaration shadows a variable in the= global scope [-Werror,-Wshadow] int qemu_semihosting_config_options(const char *optarg) ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/getopt.h:= 77:14: note: previous declaration is here extern char *optarg; /* getopt(3) external variables */ ^ Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Alex Benn=C3=A9e Reviewed-by: Richard Henderson --- include/semihosting/semihost.h | 2 +- semihosting/config.c | 8 ++++---- stubs/semihost.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/semihosting/semihost.h b/include/semihosting/semihost.h index efd2efa25a..97d2a2ba99 100644 --- a/include/semihosting/semihost.h +++ b/include/semihosting/semihost.h @@ -66,7 +66,7 @@ const char *semihosting_get_cmdline(void); void semihosting_arg_fallback(const char *file, const char *cmd); /* for vl.c hooks */ void qemu_semihosting_enable(void); -int qemu_semihosting_config_options(const char *opt); +int qemu_semihosting_config_options(const char *optstr); void qemu_semihosting_chardev_init(void); void qemu_semihosting_console_init(Chardev *); #endif /* CONFIG_USER_ONLY */ diff --git a/semihosting/config.c b/semihosting/config.c index 8ca569735d..e826457733 100644 --- a/semihosting/config.c +++ b/semihosting/config.c @@ -131,10 +131,10 @@ void qemu_semihosting_enable(void) semihosting.target =3D SEMIHOSTING_TARGET_AUTO; } =20 -int qemu_semihosting_config_options(const char *optarg) +int qemu_semihosting_config_options(const char *optstr) { QemuOptsList *opt_list =3D qemu_find_opts("semihosting-config"); - QemuOpts *opts =3D qemu_opts_parse_noisily(opt_list, optarg, false); + QemuOpts *opts =3D qemu_opts_parse_noisily(opt_list, optstr, false); =20 semihosting.enabled =3D true; =20 @@ -155,7 +155,7 @@ int qemu_semihosting_config_options(const char *optarg) semihosting.target =3D SEMIHOSTING_TARGET_AUTO; } else { error_report("unsupported semihosting-config %s", - optarg); + optstr); return 1; } } else { @@ -165,7 +165,7 @@ int qemu_semihosting_config_options(const char *optarg) qemu_opt_foreach(opts, add_semihosting_arg, &semihosting, NULL); } else { - error_report("unsupported semihosting-config %s", optarg); + error_report("unsupported semihosting-config %s", optstr); return 1; } =20 diff --git a/stubs/semihost.c b/stubs/semihost.c index aad7a70353..b3c61935b3 100644 --- a/stubs/semihost.c +++ b/stubs/semihost.c @@ -36,7 +36,7 @@ void qemu_semihosting_enable(void) { } =20 -int qemu_semihosting_config_options(const char *optarg) +int qemu_semihosting_config_options(const char *optstr) { return 1; } --=20 2.41.0 From nobody Wed May 15 16:42:07 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=1696421256; cv=none; d=zohomail.com; s=zohoarc; b=gpZP+9eJ6ByBWDH8xoaLrpaECjGodZNM0IY0FJr0yeDhgdLPBEW0fyCjN3nQuCr5B2vvGExns76ef++dvWA2fcJTesBczyo+0oK/4E+q/aHhA4USjqWGAJaW2RGuzkahdTfdqKGxLGieJL1WSs0hteirkLNBTi0DEnmIpFw47nE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696421256; 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=aaBKBsLGQ/LuJm7hrK1IdnE8JEzy7Etr5v11yBfp1ug=; b=X/SnzXcA7xMwg+i9MGoZoWyG8q77SPWxrbebzZp0obUZhxGnTRhsrOpJE5TryNriMuXCFI4EKplBvrLQnhqwMCEZi4v7NDw1wtJAF/LEbCnTsIP8MaxNivYeuLKZMu40oTwAIVKjD7xRTxDm8CunjaJPTuPl8p7jN4LNdSgoJ7Y= 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 169642125662164.23662776214917; Wed, 4 Oct 2023 05:07:36 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qo0b8-0003FY-Bi; Wed, 04 Oct 2023 08:03:26 -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 1qo0ZF-0000O1-NB for qemu-devel@nongnu.org; Wed, 04 Oct 2023 08:01:34 -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 1qo0ZC-00015k-Gw for qemu-devel@nongnu.org; Wed, 04 Oct 2023 08:01:29 -0400 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-32487efc319so2025839f8f.1 for ; Wed, 04 Oct 2023 05:01:25 -0700 (PDT) Received: from m1x-phil.lan (5ep85-h01-176-173-163-52.dslam.bbox.fr. [176.173.163.52]) by smtp.gmail.com with ESMTPSA id x15-20020a5d60cf000000b003271be8440csm3844037wrt.101.2023.10.04.05.01.22 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Oct 2023 05:01:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696420884; x=1697025684; 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=aaBKBsLGQ/LuJm7hrK1IdnE8JEzy7Etr5v11yBfp1ug=; b=Rfm1la5sKrMWtTpzIbcfi0jV0qof3ooOZgH8CpV9gcrrjH10bwiScPAgu3jx7PobnM QAlNEf3ip/u/oGVWc0JPq+x3X6pPioysbNhnWHY3rp7UDa1UKnDBIdrfUXFEpxz54Pgs YoZmz2Dqa7fe/GsGAp2UvPwJlRYj3NcS8eckt13AsBawIqC/KbN0hbIi9NgdxpXkPPsA zCdNuJEBYNXP63Htk9SfifdNCfIXEb79zO8aOPWeKccQX29jTpk6fieKn2zYfCgQtz4s jbXtMIvV9P0v3AzFS6eG1PRdRo6nvcBABmIg/oEO0KRYhqYd4twMYAsVTN2gHYmKhi6o YuQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696420884; x=1697025684; 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=aaBKBsLGQ/LuJm7hrK1IdnE8JEzy7Etr5v11yBfp1ug=; b=O7D1PYN3KTNaHZvmH10F35atMfIRa8kZ4UOkzchfffu735iOScShOqDPuSTcjXrb6F BEs+wnOB0m2+4GJRDfSmdFvhmMKciurFifhr+EsTTDRe5XNd9fRtE8wlIW/B1G732nN5 HSxbkPkZC7R+qhQxzVeEZFdklEILZ4OYNWYnnLPAOxMPzbM4hJl4zVEjYsTpvJ4Hznv8 5KavJty365iSfvfzCQ9ZzlQsHYnNkn6Hv4DYqVAi3rmHNwOIqivwSkkcjn04c0QCE2mZ /NFTiOpweB32eW3zxhGOauABg3FtnrOkPvysZYsf9wRWck7xcdS9cHsAJVeE8fBhXnnN y1Ug== X-Gm-Message-State: AOJu0Yx7qLj5X86zWWCmv/JClJk9Kl/2ohtBFKz3HSZSTVsP7qZxoE9q 69LBJa0sBrJ2GlRdd68bImj/zOG7Xka9LNQ1Atc= X-Google-Smtp-Source: AGHT+IESLymds+pnPfiIjWjB+IzTvFThDGHRqlErQmqXu4f56VtY5QXAn1g4OxkDQW/vSmLSiuryvw== X-Received: by 2002:adf:f845:0:b0:31f:e74d:c82a with SMTP id d5-20020adff845000000b0031fe74dc82amr1772147wrq.31.1696420883499; Wed, 04 Oct 2023 05:01:23 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Markus Armbruster , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Peter Maydell , Akihiko Odaki , Gerd Hoffmann , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH v3 10/16] ui/cocoa: Clean up global variable shadowing Date: Wed, 4 Oct 2023 14:00:13 +0200 Message-ID: <20231004120019.93101-11-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231004120019.93101-1-philmd@linaro.org> References: <20231004120019.93101-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: 1696421256998100001 Fix: ui/cocoa.m:346:20: error: declaration shadows a variable in the global sc= ope [-Werror,-Wshadow] QemuCocoaView *cocoaView =3D userInfo; ^ ui/cocoa.m:342:16: note: previous declaration is here QemuCocoaView *cocoaView; ^ Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Akihiko Odaki Reviewed-by: Richard Henderson --- ui/cocoa.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/cocoa.m b/ui/cocoa.m index df6d13be38..15477288fd 100644 --- a/ui/cocoa.m +++ b/ui/cocoa.m @@ -343,9 +343,9 @@ - (void) raiseAllKeys; =20 static CGEventRef handleTapEvent(CGEventTapProxy proxy, CGEventType type, = CGEventRef cgEvent, void *userInfo) { - QemuCocoaView *cocoaView =3D userInfo; + QemuCocoaView *view =3D userInfo; NSEvent *event =3D [NSEvent eventWithCGEvent:cgEvent]; - if ([cocoaView isMouseGrabbed] && [cocoaView handleEvent:event]) { + if ([view isMouseGrabbed] && [view handleEvent:event]) { COCOA_DEBUG("Global events tap: qemu handled the event, capturing!= \n"); return NULL; } --=20 2.41.0 From nobody Wed May 15 16:42:07 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=1696421084; cv=none; d=zohomail.com; s=zohoarc; b=LK6FaBYxQkOnByiOGaz9gbdi1KY7GQ/2WEMQo7ZZRxJ2z6nvtUHELovfD5FSakbvMj62aUuMiN+E+chEfvNvVkBQJtU1lqi85FcBGQv685RtrDyV0VsEqXKR37zZunYR6nAR2TNfm3M40uBQeHw/9LyQzcqK+wyoMNC6TV1/vWs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696421084; 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=9QTZPnGa7dzlAxYI3K0r+uL7KCteU3g2TmxdKpGNVN0=; b=kkI3fE801Xu8vli1ukmRU9jXItih2i+hJCNJBs3otZ9NWooiCJlpLZKbqDltzB9rDXImv4csti3e+Hz5EvbI0cgaFw62ziuL3Q0Jym8aW+sYd/wYm5lsJyc1BC5iP7tHfj89iwOgUCBatiDecIlRydSIo0yxPDhjeJfT3NGLnF0= 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 1696421084659299.8723318629069; Wed, 4 Oct 2023 05:04:44 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qo0b6-00036E-SA; Wed, 04 Oct 2023 08:03:24 -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 1qo0ZK-0000Pb-6G for qemu-devel@nongnu.org; Wed, 04 Oct 2023 08:01:37 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qo0ZI-00017M-21 for qemu-devel@nongnu.org; Wed, 04 Oct 2023 08:01:33 -0400 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-406650da82bso19153275e9.3 for ; Wed, 04 Oct 2023 05:01:31 -0700 (PDT) Received: from m1x-phil.lan (5ep85-h01-176-173-163-52.dslam.bbox.fr. [176.173.163.52]) by smtp.gmail.com with ESMTPSA id e16-20020a056000121000b00324853fc8adsm3838124wrx.104.2023.10.04.05.01.28 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Oct 2023 05:01:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696420890; x=1697025690; 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=9QTZPnGa7dzlAxYI3K0r+uL7KCteU3g2TmxdKpGNVN0=; b=AFm0zfRDJoWdXeEUqHwgxSFITCWXs1/nS40U2pGSA1YbQoX5FKNnYF/gJH4J+463hC W1nFq05MjC1BebyLaMGtEVb+JSvpspdr+ZRy/D0dtZWgSBNHJfoNrEdGjeHV70/Rozi0 rFeHWPbUZe91ubilp6d9Dy05yL6I3UToJc/EUJZtbiVA0U3KNIba6nWK3Y0hGIUoSO5d TEiSqodx2koWjfLNuIpMA1fdZsKmKmacMPY2nPegfYJ9YU/rg+FdJmi919LKZk/tJKj+ o6p2kuht2u/W0+UsHdeZbhoxDMePN5Jc/m4RmPCqSFUaNdIS9/dce8+CXbRWeTn8DOSw pA6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696420890; x=1697025690; 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=9QTZPnGa7dzlAxYI3K0r+uL7KCteU3g2TmxdKpGNVN0=; b=qRsCYd8I1Qjy8lM7NVEIeoWG85fsdh70OrqKUIZBeWrcALKiywuaptJTb55aZE2XoF Q/gaPXw7WaMMIWeqmjj34PaWbM4NVHFBJ8LYJ42OWKL5Q0yUnYhwB/DxA1bBmsKYmNqf 0ncnqTXTdZdFOuDvRH33EPkBlMz2VRKvxRlR9PonsmSY/Ly3DTDKCKv+jl/g/sSIta28 Q4VszlbRm6F5HezoVV+5FTqCYO/DOgzw1cXkRYixS7I8hSCsmcXqrWYjv2RKvnhwSpmM MdeW8WvDQHwtCbrV0BQ/uhrPkVlGctrer+2PIqOSbMM0vUKGOmHbZUJAUWHto4uYUgKN Y2dg== X-Gm-Message-State: AOJu0YxKJ2ikRFRjOcAu2D78yaMwbiGQF8tFNBoncMOgv82FALFdEySY MnjAtdCJqRyfm9D2mMId4EjYUNz0CRCFZPrUGDg= X-Google-Smtp-Source: AGHT+IFgZJVdmWW1rDVNPvd43g/WPuP39kPXM7D50nGRVd8lRFQ08yURJeYc0kn2TT47yqcmSnKBmA== X-Received: by 2002:a1c:7209:0:b0:405:a30:151e with SMTP id n9-20020a1c7209000000b004050a30151emr2290577wmc.12.1696420889413; Wed, 04 Oct 2023 05:01:29 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Markus Armbruster , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v3 11/16] util/cutils: Clean up global variable shadowing in get_relocated_path() Date: Wed, 4 Oct 2023 14:00:14 +0200 Message-ID: <20231004120019.93101-12-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231004120019.93101-1-philmd@linaro.org> References: <20231004120019.93101-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::32e; envelope-from=philmd@linaro.org; helo=mail-wm1-x32e.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: 1696421086771100003 Fix: util/cutils.c:1147:17: error: declaration shadows a variable in the globa= l scope [-Werror,-Wshadow] const char *exec_dir =3D qemu_get_exec_dir(); ^ util/cutils.c:1035:20: note: previous declaration is here static const char *exec_dir; ^ Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Eric Blake Reviewed-by: Richard Henderson --- util/cutils.c | 1 - 1 file changed, 1 deletion(-) diff --git a/util/cutils.c b/util/cutils.c index 25373198ad..b44718a6a2 100644 --- a/util/cutils.c +++ b/util/cutils.c @@ -1144,7 +1144,6 @@ char *get_relocated_path(const char *dir) { size_t prefix_len =3D strlen(CONFIG_PREFIX); const char *bindir =3D CONFIG_BINDIR; - const char *exec_dir =3D qemu_get_exec_dir(); GString *result; int len_dir, len_bindir; =20 --=20 2.41.0 From nobody Wed May 15 16:42:07 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=1696421252; cv=none; d=zohomail.com; s=zohoarc; b=GaSdl0sVEFFusV7Pwsf6oyTAcz4yIZeZ7f6N/XQA/mrzTkkBAPXughYugfKMZHNeO2Wnmun5YqmPULmsi6w7C9DyLJj3VbomyJpn5QJW0U5RJljl8/kHfFadTTRKMDZ/Nc6VMMHpSfnUo+l0+U9LpcTwWNcbOgfiP1Ibdm5/e2M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696421252; 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=8JtBXMzpsFb0+ye9vGJHcom9MCYcPPJwy9i7R/QePcg=; b=NLJYZoyzXXhdXS68YnU6hDDe3egyPdtExtald6rlSrauEeLtLdz7AiuVT385ppiQZX4awHFx9NkowVbgp4hMYiPPWh+JO2778XCHaJIaceiX2rw5CybdjOQ5jO6cQAGzAh+71fbeFuJZZy/jhbQHlQtjd3kh/vnfDiB/rxnedWU= 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 169642125231684.63930230561573; Wed, 4 Oct 2023 05:07:32 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qo0bP-0003pA-6Y; Wed, 04 Oct 2023 08: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 1qo0ZS-0000R0-3s for qemu-devel@nongnu.org; Wed, 04 Oct 2023 08:01:45 -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 1qo0ZN-00018I-Si for qemu-devel@nongnu.org; Wed, 04 Oct 2023 08:01:40 -0400 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-32167a4adaaso1961090f8f.1 for ; Wed, 04 Oct 2023 05:01:37 -0700 (PDT) Received: from m1x-phil.lan (5ep85-h01-176-173-163-52.dslam.bbox.fr. [176.173.163.52]) by smtp.gmail.com with ESMTPSA id o13-20020a5d408d000000b003232380ffd7sm3833760wrp.102.2023.10.04.05.01.34 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Oct 2023 05:01:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696420895; x=1697025695; 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=8JtBXMzpsFb0+ye9vGJHcom9MCYcPPJwy9i7R/QePcg=; b=ZAJIIhDLyaN90sKwwdR94n4Fl46z0zReNcEbd+Ml/rh/lASraSRMUNXgDS1puqsvN+ Hp3qqiwscoxMsVOaCiei1IS9QPIF2N7Zd33DRMVTdjiLpUGIzspid5q1+pCkWbgU0Hxz GX5DBgqN0kQYFtHGusMAIeNTwd3/m1iqcdzWRPHWbyBbE5wbCpVLUTgTCs3HgG3CBYAp T4f6c8C3lLqXG9dY5nV3YLmDa33XjFu12cdAhB9sOn+4x4a7NNWNqJaCTdlGCts1coRp AVFM2Gp/lJch0bqdbvcJdFWiqfK7RtzyVoglSiVOU8+49WgLUxCFbWfCz0YUtOr+PQ4E rLpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696420895; x=1697025695; 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=8JtBXMzpsFb0+ye9vGJHcom9MCYcPPJwy9i7R/QePcg=; b=hs1ShJ/8fUy53YwUeto2usWnHscewqaVj25HSP8GVXfZ6kQhmc1kDk47rt7A5N4OP+ h72kfCH9S9aoXM7vy1B1RI0MIM2nCPivwZoXGxj92LLVvG+7jR/bVred01t/faAnqUVL wWEMJ4Z2Dnyx9+QuMSK048yf+W/5u/AqV7sh/P2OmGGk0n1BeCdEDSYch5IhDB/STNry 4CI/vizu2ZB5E9iqmgZmRgmkJwzUwXp2mVDAFYIYQivCQCKTc9h9Xt63UA1/2UGxJq3K QdFfoCTEWQ9lcJX3EmSyfFz17XhCFJ6D+Gcejk8kxbYaHc+eXN/nJ1v9byhJ1Uex3K3q UGtA== X-Gm-Message-State: AOJu0Yyi6eV0boeQiqaKQTZ/HwSVmPCEDTgOyJXCf0aVBuxqF7YB7wMg +p2BFMtwa233+jlttWAEXEzL3bvbiJOsKNSBbbI= X-Google-Smtp-Source: AGHT+IHqMtwgwiEgtBRQ+8KlhWpc5r5Vy0rjEsgW/c1jEnfpdOjs0WNaZOyTv9eQsoC41k00n9t3vw== X-Received: by 2002:adf:f00e:0:b0:323:30bb:f19c with SMTP id j14-20020adff00e000000b0032330bbf19cmr1961403wro.10.1696420895001; Wed, 04 Oct 2023 05:01:35 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Markus Armbruster , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v3 12/16] util/guest-random: Clean up global variable shadowing Date: Wed, 4 Oct 2023 14:00:15 +0200 Message-ID: <20231004120019.93101-13-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231004120019.93101-1-philmd@linaro.org> References: <20231004120019.93101-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=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: 1696421252983100001 Fix: util/guest-random.c:90:45: error: declaration shadows a variable in the g= lobal scope [-Werror,-Wshadow] int qemu_guest_random_seed_main(const char *optarg, Error **errp) ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/getopt.h:= 77:14: note: previous declaration is here extern char *optarg; /* getopt(3) external variables */ ^ Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- include/qemu/guest-random.h | 8 ++++---- util/guest-random.c | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/qemu/guest-random.h b/include/qemu/guest-random.h index 09ff9c2236..5060d49d60 100644 --- a/include/qemu/guest-random.h +++ b/include/qemu/guest-random.h @@ -13,16 +13,16 @@ #define QEMU_GUEST_RANDOM_H =20 /** - * qemu_guest_random_seed_main(const char *optarg, Error **errp) - * @optarg: a non-NULL pointer to a C string + * qemu_guest_random_seed_main(const char *seedstr, Error **errp) + * @seedstr: a non-NULL pointer to a C string * @errp: an error indicator * - * The @optarg value is that which accompanies the -seed argument. + * The @seedstr value is that which accompanies the -seed argument. * This forces qemu_guest_getrandom into deterministic mode. * * Returns 0 on success, < 0 on failure while setting *errp. */ -int qemu_guest_random_seed_main(const char *optarg, Error **errp); +int qemu_guest_random_seed_main(const char *seedstr, Error **errp); =20 /** * qemu_guest_random_seed_thread_part1(void) diff --git a/util/guest-random.c b/util/guest-random.c index 9465dda085..33607d5ff2 100644 --- a/util/guest-random.c +++ b/util/guest-random.c @@ -87,11 +87,11 @@ void qemu_guest_random_seed_thread_part2(uint64_t seed) } } =20 -int qemu_guest_random_seed_main(const char *optarg, Error **errp) +int qemu_guest_random_seed_main(const char *seedstr, Error **errp) { uint64_t seed; - if (parse_uint_full(optarg, 0, &seed)) { - error_setg(errp, "Invalid seed number: %s", optarg); + if (parse_uint_full(seedstr, 0, &seed)) { + error_setg(errp, "Invalid seed number: %s", seedstr); return -1; } else { deterministic =3D true; --=20 2.41.0 From nobody Wed May 15 16:42:07 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=1696421265; cv=none; d=zohomail.com; s=zohoarc; b=QP7GqRtlu/2mJstgiFf0ID76fuWtrQ+eEp0yoW9T+3NmgELaoESKQ8/0dJScgMNB1tuFoUgTj8AbRFFFpyV+1PytxfQZHpOMWxfTyrtHGta2wfbTe+G+fZY3fovAg1XSMzcDA7pAEi5bG8rWNYKA2z8BwSl0aj9YVY+/dGQt/D8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696421265; 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=S8wZ57nmGBju5vDKBp5SHeeONo30+tUOfUJLJWu5rBM=; b=dk0JA7vdQi690YeAqknbNuTcgFlkJi2lzzc6SlrCUT7d/dMfLXL2VWvyL7HsiFx05YIQtHN3XE6zvCdEIJptVFfDBExCykXeUHjwkaQn//WaPyNqlw1NuG4MrXkGRmk1DWKtuIB6DSlbzGgRHGPCOcyhoALHg2X9obBc3jGvMds= 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 1696421265527774.2196840134524; Wed, 4 Oct 2023 05:07:45 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qo0bR-0003s4-NS; Wed, 04 Oct 2023 08:03:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qo0ZW-0000Sk-1B for qemu-devel@nongnu.org; Wed, 04 Oct 2023 08:01:57 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qo0ZT-00019H-3J for qemu-devel@nongnu.org; Wed, 04 Oct 2023 08:01:44 -0400 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-3247cefa13aso1856535f8f.1 for ; Wed, 04 Oct 2023 05:01:42 -0700 (PDT) Received: from m1x-phil.lan (5ep85-h01-176-173-163-52.dslam.bbox.fr. [176.173.163.52]) by smtp.gmail.com with ESMTPSA id j14-20020a5d464e000000b0031f8a59dbeasm3816870wrs.62.2023.10.04.05.01.40 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Oct 2023 05:01:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696420901; x=1697025701; 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=S8wZ57nmGBju5vDKBp5SHeeONo30+tUOfUJLJWu5rBM=; b=ASPt7McQQhoErHzFzwBk8oTN7THDTc0MAKq5S0f7aWfy+v75jGvkk+zU7cshZne3X8 tJcxUoRN4zs4wTFyN7/T8jFo8Qcwwrv/cBnVaktOOsgzxlurJJd/aDghhUhqCFowKTWH 56NHZqTIMTCMncT1Bbxw+oOjnTGLHJxXBz70e/TagiBM5JbCJlIwVwaQGlgrtvkPyCk6 CbtUajBlmaUzve7Mc0Nie/Clbfm00G+lIlexVWvZ79Rc3zgTHU8DW90IzqnghEC6riBc OPhUgj2B62kNNGb+QBiZ+0AInDYAbPdJf/beh0bY+6OwaiPb2ND68eFUY9SJRNtfeGRG u4lA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696420901; x=1697025701; 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=S8wZ57nmGBju5vDKBp5SHeeONo30+tUOfUJLJWu5rBM=; b=R58BULKq9w040ho7a11kdMTc4IwM75zzzsJJ9tGM6pm30GmJnAmsSJ/a39THwM+B8z LnlO+hQ75e9KkuDAPEc0FvntrOmMux/x3Er8T+iqnRrHsQtPig/jBGiFGcaij0DqLsJU CRyAiZA0bAbfJvryIp0B4Ou039oeykGZl7HfrMrHTMkJlGIfqdmquZkJQGRuxOW0ysxx Qmp51KS8EOgXuVrS4UzpCQqy/bVM7JzPstgCQnBeiemBGHIsA3xEXieZFPB3TugeRS6f sEbdaFTY18LKGNaWM6p5m92zNuezdLwjBGUYaW+CCxA5I5x/AmSR67nCQfy8b2OF+bFK jODA== X-Gm-Message-State: AOJu0YwStMe0CJaqEzn+fAjkIA+uzf+P1qcD+t3u02k36jqgRNGGhdcV 4xnw7ymls8qcxndP/WIrLlA5Z5OelK6NWRTK33w= X-Google-Smtp-Source: AGHT+IFh+h1QITEFymxYa1mOeXdp4CFUuSTFG1pWVC2Am6MR4oBUKGoOgn/svtx/ldDdjHOHYkiPlQ== X-Received: by 2002:adf:e6ce:0:b0:31f:b7b2:d4e1 with SMTP id y14-20020adfe6ce000000b0031fb7b2d4e1mr1846346wrm.20.1696420901110; Wed, 04 Oct 2023 05:01:41 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Markus Armbruster , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PATCH v3 13/16] semihosting/arm-compat: Clean up local variable shadowing Date: Wed, 4 Oct 2023 14:00:16 +0200 Message-ID: <20231004120019.93101-14-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231004120019.93101-1-philmd@linaro.org> References: <20231004120019.93101-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::42a; envelope-from=philmd@linaro.org; helo=mail-wr1-x42a.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: 1696421267227100001 Fix: semihosting/arm-compat-semi.c: In function =E2=80=98do_common_semihosting= =E2=80=99: semihosting/arm-compat-semi.c:379:13: warning: declaration of =E2=80=98re= t=E2=80=99 shadows a previous local [-Wshadow=3Dlocal] 379 | int ret, err =3D 0; | ^~~ semihosting/arm-compat-semi.c:370:14: note: shadowed declaration is here 370 | uint32_t ret; | ^~~ semihosting/arm-compat-semi.c:682:27: warning: declaration of =E2=80=98re= t=E2=80=99 shadows a previous local [-Wshadow=3Dlocal] 682 | abi_ulong ret; | ^~~ semihosting/arm-compat-semi.c:370:9: note: shadowed declaration is here 370 | int ret; | ^~~ Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Alex Benn=C3=A9e Reviewed-by: Richard Henderson --- semihosting/arm-compat-semi.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/semihosting/arm-compat-semi.c b/semihosting/arm-compat-semi.c index 564fe17f75..0033a1e018 100644 --- a/semihosting/arm-compat-semi.c +++ b/semihosting/arm-compat-semi.c @@ -367,7 +367,6 @@ void do_common_semihosting(CPUState *cs) target_ulong ul_ret; char * s; int nr; - uint32_t ret; int64_t elapsed; =20 nr =3D common_semi_arg(cs, 0) & 0xffffffffU; @@ -725,6 +724,9 @@ void do_common_semihosting(CPUState *cs) =20 case TARGET_SYS_EXIT: case TARGET_SYS_EXIT_EXTENDED: + { + uint32_t ret; + if (common_semi_sys_exit_extended(cs, nr)) { /* * The A64 version of SYS_EXIT takes a parameter block, @@ -752,6 +754,7 @@ void do_common_semihosting(CPUState *cs) } gdb_exit(ret); exit(ret); + } =20 case TARGET_SYS_ELAPSED: elapsed =3D get_clock() - clock_start; --=20 2.41.0 From nobody Wed May 15 16:42:07 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=1696421052; cv=none; d=zohomail.com; s=zohoarc; b=DtQi79zH4aYU93vNMa8cYXbebsMxTs4GtfzZzPTDPRiczc+7S8777EykVJn/MdeCXqBowQA20zLFuRltAzL0yFEtJQarif+S09yglUrru5PiIwgFlzPSjtaj/JlARjhduMtpt8oZcsl6LgHh8KT1l4IH8rSmDx2B6H1TeudUjiU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696421052; 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=VbE/h6HUxHm1fKUuktISJWotuykVg/wSDPAOtZyCrGc=; b=f9abB4+7ONq8lbewDCjy1CIINctNNKIO4wz3LOXsJXJlvPfDsARu5seGu3FeEVtadZjx4naXWNNyfp1XTHwKDjZA82rDosIJ6Q1SYa/mMeGi8zIvj1SVpnr5yC5vNv8OMuXrLvrqH8dSJ6/JuMO+HoTcULkXQAgVZ/vO5PjUfrw= 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 1696421052190573.6542625635383; Wed, 4 Oct 2023 05:04:12 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qo0bK-0003nl-Q0; Wed, 04 Oct 2023 08:03:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qo0Ze-0000WB-Jz for qemu-devel@nongnu.org; Wed, 04 Oct 2023 08:02:02 -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 1qo0ZZ-0001CB-HK for qemu-devel@nongnu.org; Wed, 04 Oct 2023 08:01:53 -0400 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-3231df68584so1912410f8f.1 for ; Wed, 04 Oct 2023 05:01:48 -0700 (PDT) Received: from m1x-phil.lan (5ep85-h01-176-173-163-52.dslam.bbox.fr. [176.173.163.52]) by smtp.gmail.com with ESMTPSA id w10-20020adfd4ca000000b0031ad5470f89sm3894894wrk.18.2023.10.04.05.01.45 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Oct 2023 05:01:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696420907; x=1697025707; 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=VbE/h6HUxHm1fKUuktISJWotuykVg/wSDPAOtZyCrGc=; b=hdDcmOioNI1LwLw1KWdoNWmvMAdoxQ5O3opOQmCc2efN0ryEmuV3wIJPTjJQEGHtwr rvt7M+wXW7pb6dwH8UqG9zfuak4cmMdzUK0NFGhP9eccAwPQuL0yPRrHnSbCRnyqZ30c OZdGcW6WQJYkIYNpnC/YCKLhtvuaWT8bzXYF35uNNBzJvpeesnWdC7YA2/MyJHgxHR3m Fy5ueucVPXHDgz50r31kgo4jVEqeyHe6rsPiw6pxcmVnvIAymyzQzSK6QbmBfnJFGH2X LhXCBNZ/bjKuKdjQTZCLDn/AssShD90taR3i6WrkyAzx+7c6u6GABR0Qwb46xWmm7j6V y0vA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696420907; x=1697025707; 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=VbE/h6HUxHm1fKUuktISJWotuykVg/wSDPAOtZyCrGc=; b=LFm4gzsh+rD4ILzc1fAH1sTKSk8HrCI5ejbp2hyuf8kY57s51f6cB2y854hAXztTA7 n+LJwMVGJaz1jBnPoxuAJqPYBHBqqper2S7OanYGvstSRZG6gnbwO9jDS2af6sXM3Rhk lV/c9GAPK0sLn6cERjznCdfqS3W5JhIwKdEHVgIYhriQokVk4fmfB3vK6BLwu9gRizYR ey45Im7ei9p05sa1i+JBlxo2ttp7I0nEePgaESsVvRELdmx4804Uvg3XchXrDuN9Cxbr PWeVJFU0w5OEk6VXvk2ihB87C0+Ild3sKWsav1YHyOPx0P8nic+yKCxsuUCoVgEHrAX5 l/gA== X-Gm-Message-State: AOJu0YzvSkykVa/oovUyM0xObD34U7ev6MZ0LcPMtUi6cq90xr7cSiUJ Jbc5dOdkh8a2AT66h/Ry9gZPqPo07CcdhK9SH9o= X-Google-Smtp-Source: AGHT+IGm4UV2ii+97ouFej/zuni8IHRqZGQ/5lAmriv3wImpdvXXr8pYR67CVUHmV/igjzSa5G5fFw== X-Received: by 2002:adf:d4cb:0:b0:31a:ed75:75e9 with SMTP id w11-20020adfd4cb000000b0031aed7575e9mr2097115wrk.13.1696420906827; Wed, 04 Oct 2023 05:01:46 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Markus Armbruster , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini Subject: [PATCH v3 14/16] softmmu/vl: Clean up global variable shadowing Date: Wed, 4 Oct 2023 14:00:17 +0200 Message-ID: <20231004120019.93101-15-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231004120019.93101-1-philmd@linaro.org> References: <20231004120019.93101-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: 1696421054292100003 Fix: softmmu/vl.c:1069:44: error: declaration shadows a variable in the global= scope [-Werror,-Wshadow] static void parse_display_qapi(const char *optarg) ^ softmmu/vl.c:1224:39: error: declaration shadows a variable in the global= scope [-Werror,-Wshadow] static void monitor_parse(const char *optarg, const char *mode, bool pret= ty) ^ softmmu/vl.c:1634:17: error: declaration shadows a variable in the global= scope [-Werror,-Wshadow] const char *optarg =3D qdict_get_try_str(qdict, "type"); ^ softmmu/vl.c:1784:45: error: declaration shadows a variable in the global= scope [-Werror,-Wshadow] static void object_option_parse(const char *optarg) ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/getopt.h:= 77:14: note: previous declaration is here extern char *optarg; /* getopt(3) external variables */ ^ Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Markus Armbruster Reviewed-by: Richard Henderson --- softmmu/vl.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/softmmu/vl.c b/softmmu/vl.c index 98e071e63b..ae1ff9887d 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -1066,12 +1066,12 @@ static void select_vgahw(const MachineClass *machin= e_class, const char *p) } } =20 -static void parse_display_qapi(const char *optarg) +static void parse_display_qapi(const char *optstr) { DisplayOptions *opts; Visitor *v; =20 - v =3D qobject_input_visitor_new_str(optarg, "type", &error_fatal); + v =3D qobject_input_visitor_new_str(optstr, "type", &error_fatal); =20 visit_type_DisplayOptions(v, NULL, &opts, &error_fatal); QAPI_CLONE_MEMBERS(DisplayOptions, &dpy, opts); @@ -1221,21 +1221,21 @@ static int mon_init_func(void *opaque, QemuOpts *op= ts, Error **errp) return monitor_init_opts(opts, errp); } =20 -static void monitor_parse(const char *optarg, const char *mode, bool prett= y) +static void monitor_parse(const char *str, const char *mode, bool pretty) { static int monitor_device_index =3D 0; QemuOpts *opts; const char *p; char label[32]; =20 - if (strstart(optarg, "chardev:", &p)) { + if (strstart(str, "chardev:", &p)) { snprintf(label, sizeof(label), "%s", p); } else { snprintf(label, sizeof(label), "compat_monitor%d", monitor_device_index); - opts =3D qemu_chr_parse_compat(label, optarg, true); + opts =3D qemu_chr_parse_compat(label, str, true); if (!opts) { - error_report("parse error: %s", optarg); + error_report("parse error: %s", str); exit(1); } } @@ -1631,13 +1631,13 @@ static const QEMUOption *lookup_opt(int argc, char = **argv, =20 static MachineClass *select_machine(QDict *qdict, Error **errp) { - const char *optarg =3D qdict_get_try_str(qdict, "type"); + const char *machine_type =3D qdict_get_try_str(qdict, "type"); GSList *machines =3D object_class_get_list(TYPE_MACHINE, false); MachineClass *machine_class; Error *local_err =3D NULL; =20 - if (optarg) { - machine_class =3D find_machine(optarg, machines); + if (machine_type) { + machine_class =3D find_machine(machine_type, machines); qdict_del(qdict, "type"); if (!machine_class) { error_setg(&local_err, "unsupported machine type"); @@ -1781,20 +1781,20 @@ static void object_option_add_visitor(Visitor *v) QTAILQ_INSERT_TAIL(&object_opts, opt, next); } =20 -static void object_option_parse(const char *optarg) +static void object_option_parse(const char *optstr) { QemuOpts *opts; const char *type; Visitor *v; =20 - if (optarg[0] =3D=3D '{') { - QObject *obj =3D qobject_from_json(optarg, &error_fatal); + if (optstr[0] =3D=3D '{') { + QObject *obj =3D qobject_from_json(optstr, &error_fatal); =20 v =3D qobject_input_visitor_new(obj); qobject_unref(obj); } else { opts =3D qemu_opts_parse_noisily(qemu_find_opts("object"), - optarg, true); + optstr, true); if (!opts) { exit(1); } --=20 2.41.0 From nobody Wed May 15 16:42:07 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=1696421228; cv=none; d=zohomail.com; s=zohoarc; b=YqeBqSbkW98sVYjZ4UJjurR59chPVOO98G2U4naEtQ7YIK06WZd+BlxBWcTzCSntdaplNzEdMdxgOfKNlDRni354rQbBYAyDJP7b6eHD/2Vc23HRV/HDligYo1vCoiXRiRuW60VCBhv648TwNzUcl2XNPhqHjBCoslwq93pk5ag= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696421228; 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=JFR7669aVf4KyLNHSFRJbfPNWIK7DIVGhVdjQEp6ZNY=; b=THImT946pso9uAMdFu/tmH3XEB1cQ7oNvZWF2RkO6xSxTTgFf2Hp7hVgoUPv0lSDpZU/y4P9D7j5JrKQHxS4BihmAkSl4SFf7fTRbB+HRGC42guvxrseMilGN5PkcFRaFfeKn4dghtrW+Zza/28wuN/9GjQKgarfFOk6SJr7v/s= 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 16964212286901021.357713066258; Wed, 4 Oct 2023 05:07:08 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qo0c1-0004PW-R7; Wed, 04 Oct 2023 08:04:24 -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 1qo0Zi-0000ZJ-I1 for qemu-devel@nongnu.org; Wed, 04 Oct 2023 08:02:03 -0400 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qo0Zg-0001Dk-At for qemu-devel@nongnu.org; Wed, 04 Oct 2023 08:01:58 -0400 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-31f71b25a99so2000258f8f.2 for ; Wed, 04 Oct 2023 05:01:55 -0700 (PDT) Received: from m1x-phil.lan (5ep85-h01-176-173-163-52.dslam.bbox.fr. [176.173.163.52]) by smtp.gmail.com with ESMTPSA id q4-20020a5d5744000000b003231a0ca5ebsm3819548wrw.49.2023.10.04.05.01.51 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Oct 2023 05:01:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696420914; x=1697025714; 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=JFR7669aVf4KyLNHSFRJbfPNWIK7DIVGhVdjQEp6ZNY=; b=c410cBrinHdXKPh/0GXFNIujJc8p4HC82P2XH8G4B3vdYLUvxsIUdRnhmrvAD/dkeX cuPjaKXmXo23PPNdFeV8KdzLJMk9XNArzbfyVT6ygFFdq+mo838RliNJ3YjWdT/rUNCz doDJqYQIIhuXp5WaseOgHjy3Y9LK9ZA/4lPy2mGeHTiwIjcfzs9KETQRggujMmPozxF+ R6P3uxxLgGR4d7JgI2N7pALGnRhlwHX1Vt/JiV3qldwsHgERQEbI0AVEMtf3bZoMI48w pHay0DIcmyCZN8mcS1MtyM7fAkpK6aYAnGd1lMxTvhY7yEZ+jGE4IBpltUDtFlTz1avG Pyag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696420914; x=1697025714; 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=JFR7669aVf4KyLNHSFRJbfPNWIK7DIVGhVdjQEp6ZNY=; b=ZztG/2bvfdhRKqFyE1+mQlMx6VvlztduCB2ZPql8w1NQlOeH/Xa2CoPxLjxOlLuxpg OGzR+udvZRYHsM0RFqOOGsdgHd3inny2K6JkoK0ZVtpw2OUwGT4+t4b9YOaw4fwlblbm y+F1T0dGGmteRzuEN/1DK2jaaLFsnKCKuz2LOpQV2ZeuN+xmhQNKo0Gd1dwQsTELE6dP GxQxsFZanfJoaTsCUQPmXmhM/l0iWGoIfOqldjuPGvNXX4Jh2KE1Cd3lSAzCjaGLPovP Q60RJ2ixWaPEVEj7OyQlGSOZJ6DBctASz11MY1CRoEu7Lx++GtvKOlzyu5QIxmrGtK7I lpwA== X-Gm-Message-State: AOJu0YyY22Yjq0JLlgKzSacPM+mfbyLAWOZVoJZhn9V2c39CDfk78le1 qGoxpD1aFVn+Kg18GvuJIrHWh4ZMQ7ecFOaxOYs= X-Google-Smtp-Source: AGHT+IHZ41iGInbPZOVU8UhgLtndX8zP3LDRDVfJV5h821e+xsqPNMXYAvE4PA2cB5n8T97TgZh+Xw== X-Received: by 2002:a5d:4586:0:b0:321:5e2f:37e1 with SMTP id p6-20020a5d4586000000b003215e2f37e1mr1904926wrq.19.1696420912872; Wed, 04 Oct 2023 05:01:52 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Markus Armbruster , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Stefan Berger Subject: [PATCH v3 15/16] sysemu/tpm: Clean up global variable shadowing Date: Wed, 4 Oct 2023 14:00:18 +0200 Message-ID: <20231004120019.93101-16-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231004120019.93101-1-philmd@linaro.org> References: <20231004120019.93101-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::434; envelope-from=philmd@linaro.org; helo=mail-wr1-x434.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: 1696421230283100003 Fix: softmmu/tpm.c:178:59: error: declaration shadows a variable in the global= scope [-Werror,-Wshadow] int tpm_config_parse(QemuOptsList *opts_list, const char *optarg) ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/getopt.h:= 77:14: note: previous declaration is here extern char *optarg; /* getopt(3) external variables */ ^ Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Stefan Berger --- include/sysemu/tpm.h | 2 +- softmmu/tpm.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/sysemu/tpm.h b/include/sysemu/tpm.h index 66e3b45f30..1ee568b3b6 100644 --- a/include/sysemu/tpm.h +++ b/include/sysemu/tpm.h @@ -17,7 +17,7 @@ =20 #ifdef CONFIG_TPM =20 -int tpm_config_parse(QemuOptsList *opts_list, const char *optarg); +int tpm_config_parse(QemuOptsList *opts_list, const char *optstr); int tpm_init(void); void tpm_cleanup(void); =20 diff --git a/softmmu/tpm.c b/softmmu/tpm.c index 578563f05a..7164ea7ff1 100644 --- a/softmmu/tpm.c +++ b/softmmu/tpm.c @@ -175,15 +175,15 @@ int tpm_init(void) * Parse the TPM configuration options. * To display all available TPM backends the user may use '-tpmdev help' */ -int tpm_config_parse(QemuOptsList *opts_list, const char *optarg) +int tpm_config_parse(QemuOptsList *opts_list, const char *optstr) { QemuOpts *opts; =20 - if (!strcmp(optarg, "help")) { + if (!strcmp(optstr, "help")) { tpm_display_backend_drivers(); return -1; } - opts =3D qemu_opts_parse_noisily(opts_list, optarg, true); + opts =3D qemu_opts_parse_noisily(opts_list, optstr, true); if (!opts) { return -1; } --=20 2.41.0 From nobody Wed May 15 16:42:07 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=1696421247; cv=none; d=zohomail.com; s=zohoarc; b=jaMw+NKzEupM8tJcwYw+wC8fUFXboKroa3VLjLGF7WKhwedqwqvBK1NtX2lCmdBP6+9MDbxBy2hh+jwgG6rIpFctj9sNM0DDyoqDz1AhoIMYqis3ofuPIwY7n2CByPirtkAj6uKAM7o0Rrp0fUIno0ei6NXYeJnrLJHGwN38/98= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696421247; 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=bBGVE0DoG3fp73QBVo0q6OJfPVhOCAa/aXxiQ7+SOqM=; b=bwvF2DRE4gdOajl1Vcn5b41Q1QIf2dbAmDpq1gGkBmMUnPYFm+RAwyQlwUTpV3FD+/CY7V0HkkMT8Vg/34ZzNVmQbEvUBW8eJjV8g+Djj2T6NA6iVpmcpXgEIChngMgArMEXESdqfbSMp05cnV66dQ2Tdxg6KB3ddE3O1IRlWa4= 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 1696421247803556.6359425397782; Wed, 4 Oct 2023 05:07:27 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qo0bq-0004Jh-St; Wed, 04 Oct 2023 08:04:14 -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 1qo0Zy-0000iQ-14 for qemu-devel@nongnu.org; Wed, 04 Oct 2023 08:02:18 -0400 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qo0Zm-0001H2-2r for qemu-devel@nongnu.org; Wed, 04 Oct 2023 08:02:09 -0400 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-4064867903cso20899025e9.2 for ; Wed, 04 Oct 2023 05:02:01 -0700 (PDT) Received: from m1x-phil.lan (5ep85-h01-176-173-163-52.dslam.bbox.fr. [176.173.163.52]) by smtp.gmail.com with ESMTPSA id q23-20020a7bce97000000b003feea62440bsm1351186wmj.43.2023.10.04.05.01.58 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Oct 2023 05:01:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696420920; x=1697025720; 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=bBGVE0DoG3fp73QBVo0q6OJfPVhOCAa/aXxiQ7+SOqM=; b=TE5CK8a90U5D2mlq/2X2jrpsmiQUwjjXA9laJk8hU817U+l+11qJY10K4lIBmprLry KqJ97qNrifVn40AAId2BxJ8o5btJP9uxzHJqlR+a6uK6i3Z3aOR62xedab7oQDpHFp3K 7kak/o9wcyV8B6PclALOz/PtUlRyuM/JRHSiU41ERffu3C3Q6YeAmThSVyPdhEEvmPbi 6KXBKv1fL/c0yK0xyYXG5BVQ4glqQCLQ25+bIE2Rm4nIx+tDHBl/dQrHzT1Hnb50ICBP 1/9K4uTRO9+It/SfNQDKBgcSMNtplzqNz1stmkPo7acO0fYmjjYimrochHTZVbh4VTiw ej5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696420920; x=1697025720; 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=bBGVE0DoG3fp73QBVo0q6OJfPVhOCAa/aXxiQ7+SOqM=; b=WzEQCBsKzCYoYSOh+mda13gC09Fk64CseFE4cspMkyL7fLnB1B0k6fg/htQBa+wY90 pla5rS5vyxAM4bbtKqjMgyG/lxCkzP8IRtqPSOakZQfN4qiL/TOjswbNGsJvLGq7yZsd prgOwLRwOCZqb3DJoe32c5Ni+Jyaj9rpAbdewndpfTo/A3HDyJDw8V/oKtACTHa21Ggk kHaSBQ66KM6QZna287k316Il49C6a8G1j1dWAEQtzTUCLenkwBI3WRe1kjaLHCngFb8y qSWW/Wm7L0NmKHXzCKDUowpV3+Gonqy7Mmn1RNEdvTr9eXSd2TknanhwCU0exmLweQs8 aCTQ== X-Gm-Message-State: AOJu0Yy8LD1JUfoOvfIqQqLqWoQ1aYi1Y0X15OAkyMz/tBJRXaJScmRq 5o1M3SwEVLXziftknFtQRCV/QzBh/+NQ4BK7s38= X-Google-Smtp-Source: AGHT+IFKBiCh3mm7umXWjhYGHybFCd7VpPslSYNol+gjEruY4r/GKaSlgvsZ8tS/yjSxFEIR6zFveg== X-Received: by 2002:a1c:ed17:0:b0:406:7d74:a29e with SMTP id l23-20020a1ced17000000b004067d74a29emr2149020wmh.19.1696420919371; Wed, 04 Oct 2023 05:01:59 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Markus Armbruster , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Stefan Hajnoczi , Mads Ynddal Subject: [PATCH v3 16/16] trace/control: Clean up global variable shadowing Date: Wed, 4 Oct 2023 14:00:19 +0200 Message-ID: <20231004120019.93101-17-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231004120019.93101-1-philmd@linaro.org> References: <20231004120019.93101-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::32a; envelope-from=philmd@linaro.org; helo=mail-wm1-x32a.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_PASS=-0.001, T_SPF_HELO_TEMPERROR=0.01 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: 1696421248755100001 Fix: trace/control.c:288:34: error: declaration shadows a variable in the glob= al scope [-Werror,-Wshadow] void trace_opt_parse(const char *optarg) ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/getopt.h:= 77:14: note: previous declaration is here extern char *optarg; /* getopt(3) external variables */ ^ Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Stefan Hajnoczi --- trace/control.h | 4 ++-- trace/control.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/trace/control.h b/trace/control.h index dfd209edd8..6754bfe052 100644 --- a/trace/control.h +++ b/trace/control.h @@ -197,11 +197,11 @@ extern QemuOptsList qemu_trace_opts; =20 /** * trace_opt_parse: - * @optarg: A string argument of --trace command line argument + * @optstr: A string argument of --trace command line argument * * Initialize tracing subsystem. */ -void trace_opt_parse(const char *optarg); +void trace_opt_parse(const char *optstr); =20 /** * trace_get_vcpu_event_count: diff --git a/trace/control.c b/trace/control.c index 1a48a7e266..ef107829ac 100644 --- a/trace/control.c +++ b/trace/control.c @@ -285,10 +285,10 @@ bool trace_init_backends(void) return true; } =20 -void trace_opt_parse(const char *optarg) +void trace_opt_parse(const char *optstr) { QemuOpts *opts =3D qemu_opts_parse_noisily(qemu_find_opts("trace"), - optarg, true); + optstr, true); if (!opts) { exit(1); } --=20 2.41.0