From patchwork Wed Oct 4 12:00:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 729289 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a4e:0:b0:31d:da82:a3b4 with SMTP id v14csp303432wrs; Wed, 4 Oct 2023 05:03:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHfJh9mGj66Z0sKJGTNkC+5laX4Z4JVM6zSlyuRFLRXF2P5F9nFL07STYkrpo5hpb0RLMiM X-Received: by 2002:a0c:a891:0:b0:658:1f8b:740e with SMTP id x17-20020a0ca891000000b006581f8b740emr1683954qva.31.1696420993262; Wed, 04 Oct 2023 05:03:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696420993; cv=none; d=google.com; s=arc-20160816; b=mjOjDt98jgH8jPEJW1mBiV+6ed7sAaQoOFRUnTlBdSXFdoPZwGNbWJbq8oBbxdf4gl irhY4RIt7cIM2FQgxAXzKIG8YpBpttDCgvefta17kHpOnDh5fNTpiCCwlR9qavkxt771 o+xQweK917zs4mEWAlRwlw8bXC3zgu2/P4RHUCJW+EaHZ+sJ1cJXWQ9s0ERrJ/a9u3GU ZXovQlzqU3XgCFPoK7AOxAj5P2yuQoa2LSL99cik1BgmqX/Axi3JSrYKVA6nZn3tgT1k QBjFhWEklJD3asSxEL/2pilGLjNnr4fR+It+5NN0nFxDoct+NOCjhDkcRsYl0VHHDndc VahQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=0ChBQXwNW4QJm3R3JDhJpohyouOc36v+LlRUPzDRwbg=; fh=mrfMbe9nF1LBFU4Un034DmPrJ3FUXxBP0n2zdEpy2Pg=; b=sbMkGF389oj3Zd4aaUk13Sn4azD9fjYp9D8baux97p6vlUFOX2tlsyonotikr0lu/f 3hRSYm0ZlRgMQZ8chydaXyoPBfwtXuaSMhsVvzGUzh4mw58bDvUKkZgmiG5eJRFnV5x4 mjBjTi13e43O0oH6RFaYrgRArkmnWN6nycCfr2fSG5AGDt6zqTB3p0FgIh8c5k5RIf2g w0usD74mJ8TOm12JPTBtnfy7joXdFHK4VM+96ZTF/TszNdiiCVv9G1FLce+sGPu3uimb bByvVmw62Wh/DKUh9KFlejDmM+eZySiPonX/M834WqJ9TBX0OYBKuY1O36xZ1y+a+rJj 7VIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jeLv0vw2; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id v2-20020a0cdd82000000b006563f18c948si1399166qvk.367.2023.10.04.05.03.13 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 04 Oct 2023 05:03:13 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jeLv0vw2; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Markus Armbruster , Thomas Huth , =?utf-8?q?Philippe_Mathieu-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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Fix: hw/audio/soundhw.c:86:33: error: declaration shadows a variable in the global 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é 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 char *descr, 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); #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 = NULL; static const char *audiodev_id; -void select_soundhw(const char *optarg, const char *audiodev) +void select_soundhw(const char *name, const char *audiodev) { struct soundhw *c; @@ -92,7 +92,7 @@ void select_soundhw(const char *optarg, const char *audiodev) } for (c = soundhw; c->name; ++c) { - if (g_str_equal(c->name, optarg)) { + if (g_str_equal(c->name, name)) { selected = c; audiodev_id = audiodev; break; @@ -100,7 +100,7 @@ void select_soundhw(const char *optarg, const char *audiodev) } if (!c->name) { - error_report("Unknown sound card name `%s'", optarg); + error_report("Unknown sound card name `%s'", name); show_valid_soundhw(); exit(1); } From patchwork Wed Oct 4 12:00:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 729288 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a4e:0:b0:31d:da82:a3b4 with SMTP id v14csp302700wrs; Wed, 4 Oct 2023 05:02:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH+PLU+TuM8HLcmu6+QHKvB5mrPPQm4/vDgNennsM+Pd3/YFrQ0MfsFXQY0mwMyrnHf4qQ8 X-Received: by 2002:a05:620a:911:b0:774:2915:d180 with SMTP id v17-20020a05620a091100b007742915d180mr1947430qkv.37.1696420931388; Wed, 04 Oct 2023 05:02:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696420931; cv=none; d=google.com; s=arc-20160816; b=H/+VPwSbRxlv/PGtftXa8XS0yd3X7HOze7xqObjx+OMFsH4LDtrtoaXrI109ssLijA PFPGTxFGZJzm6ispVzyJwT3G1Y5rtyMNlSfpCCIBDJTUOnPPDWZra2kUU/DvC/Ug+rDY 3C4IGxBolv4ovyMMYKiJmMRCRE2aUoHmprxyg2W8ADRUprMwL6ayCUS5Z9d2vjnNAwFt 1UTiHFWXmVNmTTiEry0qbYFoKm4IdqlxThP6WhRcuCBIqcXZG6oJJA4QVfnPv5WcfPix fIfDZIu6vRrG0UOVYn5qUF3nMgtzrUQCm80Pn4p/EXpPzBSU1bRifjPPsQUzJ/FgKMkK cQBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=TCSsB1yBxNop9ElFEQPzo8eRpaAPTBMtrtJV+7OJslM=; fh=lhdsMERe973z4lHvDGpqQDjDnXn01ffOfMbrOmuJz70=; b=UbqGe4uevDrmcB5wOVqF/jwWeoa15GHl6qGtYZprjAELehi8JzaFoiToHkfGwYuvns GPTgMbdx7ets5zp8l5Nb+AGIpVpDDusSu5gL3J/qnAiabmRCsquu5Ry/w7RQinLzdZUP 7yFdJ88KP/GeAc3Rs4q7ZxzL8gsMs1vwbrXOdjcIl9CYgp8+C0QAOaAiPmi/55EByNcH txyFP6FfnEKU+HYhKJJyr7Q3GRYcjfHrOfWeQzlCe5G1/50i6IndSz6HL5CPIaZg+sWz IKWckPZKp4l9kOYGG1i7/t9rzgfAtCcRDB0Kj++HHQ+H7AoAOWzKS3x1C4NkUoXxvXgA Lo/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=t4338tGY; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id bm31-20020a05620a199f00b00767b568becesi1411691qkb.486.2023.10.04.05.02.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 04 Oct 2023 05:02:11 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=t4338tGY; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Markus Armbruster , Thomas Huth , =?utf-8?q?Philippe_Mathieu-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 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=philmd@linaro.org; helo=mail-wm1-x32d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Fix: hw/ide/ahci.c:1577:23: error: declaration shadows a local variable [-Werror,-Wshadow] IDEState *s = &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é Reviewed-by: John Snow --- 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 = &s->dev[i]; for (j = 0; j < 2; j++) { - IDEState *s = &ad->port.ifs[j]; - - ide_exit(s); + ide_exit(&ad->port.ifs[j]); } object_unparent(OBJECT(&ad->port)); } From patchwork Wed Oct 4 12:00:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 729298 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a4e:0:b0:31d:da82:a3b4 with SMTP id v14csp306041wrs; Wed, 4 Oct 2023 05:06:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFf6XlZp2MDWEcRan0BgE6aAmAINdE1rgKZLh+7v57rnlMEj69wbFPs5H/UXzWEXTB6P6GP X-Received: by 2002:a0c:8e8c:0:b0:64f:60e9:9285 with SMTP id x12-20020a0c8e8c000000b0064f60e99285mr1969939qvb.30.1696421183637; Wed, 04 Oct 2023 05:06:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696421183; cv=none; d=google.com; s=arc-20160816; b=yohsneUXOHeYSzGA20HkttpWOPEcsw4YedbtSYwkGWE7H8BgEMLnxzxOXVqbRi0FhW GXkIhaS3LfgV1TDNk6vyq0KDQagUgJ2aP4MW4Z5417kevfHVt+OhW4RVgY/uH34ywFkT gVz+89ijf/l8WcGEsnZFoRcL2ceZ4jEzHGaukk9/mQSaZcIv4eo9I41m1k+WESqgvMfX jY23kZmSNQK+jb6BvvsADArGSZkzWQ7pZ+YbFrUC8RO4Q3rBfpNs7sY3Ec9EhztgSPhw 65uAtTzH6CUXYInWWNaYjA+MInUsxUvYglboJ+ZXNLBN+xaRdGKE562QdMSjJINEeKgy N9fQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=KXIlmQvg0u+x76lQsbY8y6+C0hwUwSmaUkTgJ1Odfb4=; fh=lpwWP27Xja+L1z8kOOsB22ji3an6MCY+bu5H988t+wQ=; b=rJvwKgp8SkmNN39e6RjUcGu1oNbpVIgbgfHq10hcBSnxiaoOcR50Q1Vh3aYSLDirWp xISYGHL3jE0t2sVvgONCGYGnPyrQdbNfD8e9jBxhXedisbrYj800KLoiewIkP1hCh1jE XfIWFTq7RFw1kfhxkzqeVEy7PfyGAzvGOofPyjbHuq7rjiNcKDxmDT6Ggi3EuO7Wukod RPTYluhTZ22H8TXKQb5NTA/+XHBQ3Ax/MeDhUT92rog10AqPyyUl1xLtC/YV6JEdRD+J kjAcxfK2OP64ILU9F0zm7KTyv5las2beGL3yRnMcgZlytu+Ad4iy6O5yeK44xcMjDMlX 1Wyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AF7y+p99; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id j10-20020a0cf50a000000b0065af42e31e3si1351880qvm.295.2023.10.04.05.06.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 04 Oct 2023 05:06:23 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AF7y+p99; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Markus Armbruster , Thomas Huth , =?utf-8?q?Philippe_Mathieu-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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Fix: net/net.c:1680:35: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] bool netdev_is_modern(const char *optarg) ^ net/net.c:1714:38: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] void netdev_parse_modern(const char *optarg) ^ net/net.c:1728:60: error: declaration shadows a variable in the global scope [-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é 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[]; /* 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 = { { } }, }; - if (optarg[0] == '{') { + if (optstr[0] == '{') { /* This is JSON, which means it's modern syntax */ return true; } opts = 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 = qemu_opt_get(opts, "type"); is_modern = !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; - v = qobject_input_visitor_new_str(optarg, "type", &error_fatal); + v = qobject_input_visitor_new_str(optstr, "type", &error_fatal); nd = 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); } -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); } } From patchwork Wed Oct 4 12:00:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 729292 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a4e:0:b0:31d:da82:a3b4 with SMTP id v14csp303509wrs; Wed, 4 Oct 2023 05:03:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFdaHxRL8n7IPLcfMWudgkvE241ojaMUmLmgXOv7wJHaDEzE4r7prF1lImgMGZuFm5bnNOx X-Received: by 2002:a0c:ec90:0:b0:65d:f1d:d383 with SMTP id u16-20020a0cec90000000b0065d0f1dd383mr2200506qvo.3.1696421000081; Wed, 04 Oct 2023 05:03:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696421000; cv=none; d=google.com; s=arc-20160816; b=jnbHYjjdasKIIsDOMxFGvReK27QFZfWqK8rAt3SJk/IoPoIhSvk6s0q4SIqDrkGyLk 4WJdajgCEoMkZzZJ3aS3mwjA5TowlC+Wp4XxKa5LzzdGV1/E6m6yBOjzdADXOCXhWRcR EmxPbexm7KGEjOmGfE2qrbNFCwKEJ18OJ6X+PfVshKExMENTQqD5H4puznP35ei5xgGE 3FNOrfbieOlkEFqwaSz9aOVJlBRWjX+XLgO6sh/aQbr2roZCtCvSvVm0WCs9aJ/DC4Jf eJjdcPc713okKaI3NrLiIxceH7DjOPsl3fY6p9Ac0hEDKsKlbY0ErC5Ok6RQhCFS7yR2 lnIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=f0GICmTJrrPt/1QlpCchvnQWSMZXbQVxu/WDlIYHaUw=; fh=DGsemwhdqtom3k1xyp/Ay3eBo/+/1/cVk5wggzCgk24=; b=dLXCApUnvXQfjX4qtxu0nkT/bkbefzJvlsMXwKFmqmmG/RxjWmMndSIBDPsaM5D9Ay 3sz9yzIATEmo0QnRpIyRqMdVmPySm2rCKW2r266Sl7IiJvtkZjK6uuMTe+4jNjQeAKXB nkyp4YvS9FDae4kDA7+TJSuVaU8QmrHfi31q/cpwjFaKAwBuJ/OR+0FAgeJqYjQHsZW5 Bn6T4DhBD06JT/3t3hAxudhVWdRlegNgRN+oNoFfY+C6ALIgNEcfUdaR1Yj405kVQisE 4RFHzRS5r1u3AlhiUXDkEEjJLj0oYeHIhI9qre8rsjSJaxBASqec8nQZ8GXauZVkBcpA wUSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nkBv0Brz; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id f12-20020a0ccc8c000000b0065b305bbc43si1348614qvl.534.2023.10.04.05.03.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 04 Oct 2023 05:03:20 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nkBv0Brz; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Markus Armbruster , Thomas Huth , =?utf-8?q?Philippe_Mathieu-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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Fix: os-posix.c:103:31: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] bool os_set_runas(const char *optarg) ^ os-posix.c:176:32: error: declaration shadows a variable in the global scope [-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é Reviewed-by: Eric Blake --- 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); 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 = (uid_t)-1; /* -1 -1 >=0 */ static gid_t user_gid = (gid_t)-1; /* -1 -1 >=0 */ /* - * 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; - user_pwd = getpwnam(optarg); + user_pwd = getpwnam(user_id); if (user_pwd) { user_uid = -1; user_gid = -1; return true; } - rc = qemu_strtoul(optarg, &ep, 0, &lv); + rc = qemu_strtoul(user_id, &ep, 0, &lv); got_uid = lv; /* overflow here is ID in C99 */ if (rc || *ep != ':' || got_uid != lv || got_uid == (uid_t)-1) { return false; @@ -173,9 +173,9 @@ static void change_process_uid(void) static const char *chroot_dir; -void os_set_chroot(const char *optarg) +void os_set_chroot(const char *path) { - chroot_dir = optarg; + chroot_dir = path; } static void change_root(void) From patchwork Wed Oct 4 12:00:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 729290 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a4e:0:b0:31d:da82:a3b4 with SMTP id v14csp303483wrs; Wed, 4 Oct 2023 05:03:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG13QaLsAFPnDSK/o/4DVBgu6Wxnp52WPBCL9oeJdqKFADV4LtCO8SSfWGbOFMweRvNLgcn X-Received: by 2002:ac8:5f90:0:b0:418:3c05:b52b with SMTP id j16-20020ac85f90000000b004183c05b52bmr1900480qta.59.1696420998709; Wed, 04 Oct 2023 05:03:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696420998; cv=none; d=google.com; s=arc-20160816; b=Oxpr/92erCsrPJCFYQ19xeiEgiP9aWltLRlgIc4Khhvb29USLPRB8ZGQbe9Qb4zzcT U2UtQLyylsJ2rW0T18WTwZbTiyHO/jasILPmNF085fWcUKVaI21577fXYrjCn4PatKXy AXDNhZrlPvVmO754cI9u/xx/Xo4nXJo4pU7NuA983cFTwjfYtsa3AVuthN0XzGyyxNu3 hA2c1TGXVuT+91XHTDBrUVWP6JijSmG8JDGDjuWqiU9ugL6+ZKkqW80GsL09sJT1DuWO YSDCIdHOlpCE0ChxA4/GpCedpZRgWxCeOXxInBjZXSGPq9iDGrNf1XkPabl4hl46IbQj EhKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=uFvZwDADzu+jGNLm/Nr1aEk3hDp0zJEDlovZc+F59xM=; fh=CNsjeNie6BAg8/8M0tRWCL87LCJMuu7o8iXb2FRs2W0=; b=N6DxwYGoGP68uC1rU51GeRWyCo0+nx19hKHL1OWjLq02wJdoLnMbcKn4g9vOsHVvoB HyOg67/Y6AtSV08HB4WJ3RyrqosWPXUENAK1ycBkGhMtafZ69lud/Z5XzftdteiDj9bh /TVTKu8EdcAAJJUfBk3pjkbty4n8uiJ2y4m8xwE0ztWuk0IiDugu9Wq/Dk8WWGgQkQRN MJGRMib3FFNWZjVHisNDso1afRW5hntsLeRg1hDEhVvrvE3k5Kmso0BhzBXN4WEzekLK O8DrFP1pRHqKjHobCMCZNfmakvlwpFB4J1xjR4qfOmqvnqHptyhD7kJ+0Hr9I2VQYd5o o+BA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CfIHqfe+; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id e9-20020ac85dc9000000b004198efe4596si1382787qtx.70.2023.10.04.05.03.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 04 Oct 2023 05:03:18 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CfIHqfe+; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Markus Armbruster , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Alex?= =?utf-8?q?_Benn=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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Fix: include/qemu/plugin.h:245:54: error: declaration shadows a variable in the 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é Acked-by: Alex Bennée --- 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); } -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); 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) { } -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; } -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; - opts = qemu_opts_parse_noisily(qemu_find_opts("plugin"), optarg, true); + opts = qemu_opts_parse_noisily(qemu_find_opts("plugin"), optstr, true); if (opts == NULL) { exit(1); } From patchwork Wed Oct 4 12:00:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 729296 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a4e:0:b0:31d:da82:a3b4 with SMTP id v14csp304331wrs; Wed, 4 Oct 2023 05:04:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFPjh0eydHBDxlcx1iLUwpzZVcwuvdivO7i3WU/F+IvADgW5ca2lRsTuW0xNjGON11SgUNT X-Received: by 2002:a05:620a:c8a:b0:773:d86f:ec88 with SMTP id q10-20020a05620a0c8a00b00773d86fec88mr1912869qki.35.1696421061051; Wed, 04 Oct 2023 05:04:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696421061; cv=none; d=google.com; s=arc-20160816; b=SkPb0D7/PtOjMKJE3rXth2SRLN3S+OaLrZz8m8p+u64wDdmyMWQf4sSoOFuIQ8QezP LCVL+fK6f1Hzhl35AW/QVu8MlHMLkfQfBqqaHn9YQa5pRGpzqEeAks1aItsopwYK8g7+ 8c32h2awJxWLFLdB7y812F1QYvUmAf2L7FKomV7NpBpDAf8Gvnu7ZggyhSr71/pbjDft neX5q6wBrcVDfejSNXWWqmUaaUa+71EUujpAdE0yEhf//XSvRsy2IglVGM+7kplcOCEC y3+BvQJLqp+DBtG4SE1VskBi8yhW5hc1tLL2zAOG7Pd0O1cWaTA1donaIIf45EbUoDsQ lZkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=DZOn2Cyb3kswX+CAOC8A0GBq7vdEIRLvrDWoI8N+PSM=; fh=O3z/qjtWbp5mez4JaaarIdaa+p1KfZs0wGnyIdzJiqY=; b=xakUWJfdwhu8+vcJgXR72I6iU/Use/qQC1q08y3L8FX0ukClO9LTazdmsvK5vFEveR FIhAcM22RRszMGRFxAKCEtOm2AqzPhCKHEdMrOP9pMBa3pIe4iQzfIMOF7OV+AnC1moF rb86wiChbBG5x+FO4y1eO8BIr/sAOTgyizNxV9rBDsb9o8IifYCHepA9M50Wm3Qb32f4 EbAE74H13fWRvNH1qj8xfpxjng7VSKnLwXx8u0PMhzuK86UZHUWEfXlGXAAaxcUfI+iu ZXqZw0tzH8Yn8oMJ/kasSagCqQftS4R1aGvaTw8Gh7KYjIkdNc5YwOD9BkaCyAhYVy51 zoUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=t3mZf4Pt; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id h7-20020a05620a400700b0076db80c4929si1414625qko.749.2023.10.04.05.04.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 04 Oct 2023 05:04:21 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=t3mZf4Pt; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Markus Armbruster , Thomas Huth , =?utf-8?q?Philippe_Mathieu-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 Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=philmd@linaro.org; helo=mail-wm1-x336.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Fix: qemu-img.c:247:46: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] static bool is_valid_option_list(const char *optarg) ^ qemu-img.c:265:53: error: declaration shadows a variable in the global scope [-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é Reviewed-by: Eric Blake --- 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) } /* - * 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). * */ -static bool is_valid_option_list(const char *optarg) +static bool is_valid_option_list(const char *list) { - size_t len = strlen(optarg); + size_t len = strlen(list); size_t i; - if (!optarg[0] || optarg[0] == ',') { + if (!list[0] || list[0] == ',') { return false; } - for (i = len; i > 0 && optarg[i - 1] == ','; i--) { + for (i = len; i > 0 && list[i - 1] == ','; i--) { } if ((len - i) % 2) { return false; @@ -262,19 +262,19 @@ static bool is_valid_option_list(const char *optarg) return true; } -static int accumulate_options(char **options, char *optarg) +static int accumulate_options(char **options, char *list) { char *new_options; - 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; } if (!*options) { - *options = g_strdup(optarg); + *options = g_strdup(list); } else { - new_options = g_strdup_printf("%s,%s", *options, optarg); + new_options = g_strdup_printf("%s,%s", *options, list); g_free(*options); *options = new_options; } From patchwork Wed Oct 4 12:00:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 729293 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a4e:0:b0:31d:da82:a3b4 with SMTP id v14csp303620wrs; Wed, 4 Oct 2023 05:03:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEk7NWXnig86QeKl7i4Csq39F0j3kM3PD+FOvIiUwEyeKXvVBnYSWnAVRNhXLg3DrmPUb4e X-Received: by 2002:aca:1219:0:b0:3a4:57a7:b30e with SMTP id 25-20020aca1219000000b003a457a7b30emr2167840ois.26.1696421009783; Wed, 04 Oct 2023 05:03:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696421009; cv=none; d=google.com; s=arc-20160816; b=pkeq65BySA822hFT0TBjC641Bm59QOFdUaWfxYI3Csd4Ym0BrNuanEJBTtjjK3R3p/ Z+/7hLTmUigKA4tmCsJSHH23kUfua1A/hBzCLZywyn48/yF7qHTqVlOYy34nljzEXed8 lZiqlJxGx87x0d75Be/tRioI1pDn2KiBETOrAN9Iu8i1QAvUqi3NKRv+lFcgjlD9bYkX 0tmsbtscVTgvz6dB1ifQ/STuo0v668mCTebKRXuHpF2lyLBKmSdfvvz0RZee7WGns+Ws HlwkftCPcm4hTnjKKz9Qlt1dv5aHIFXbHptwDORaeCGJyae3I0rKIBTo6mDL9xK5UEVa Vg2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=6gKDMfa7dSai1h/sgemtp7pr068K3EYlzpE9zbZdHuU=; fh=O3z/qjtWbp5mez4JaaarIdaa+p1KfZs0wGnyIdzJiqY=; b=VsiewDjJUsN1lOFI2avTpqhs7ReIJRh7qZ/lh7bHaLazizvpFPTVkGfZ+Fs/EKoBZy 7f5cmbozYLWmQDmz8+TnyhiwsXhfmxgR+J41zRRpEn5CuN3spPU2sX1Lc9mY9yCKaFKu v9wois7Anb8wnFgSj+MDQWkl/5w2VNgWxpsaPC8nT5ueUK9E2eZCG1sAhfdT+3WvoLsJ Y94/MA1fiBd7suFx9sjHIE+P3oD+K9yAxBZM+jpf7leytaNAwN19fkeAOsU+8J/tS89j Z89EovfK1gAgRQEvtpl9eR2ux3XpygOVqNM3otcTH8+PXLnn9GVuv43aTvhGbrlK6oZR HKEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mo8FY6sU; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id x18-20020a0cb212000000b0065af39cfc39si1374393qvd.331.2023.10.04.05.03.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 04 Oct 2023 05:03:29 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mo8FY6sU; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Markus Armbruster , Thomas Huth , =?utf-8?q?Philippe_Mathieu-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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Fix: qemu-io.c:478:36: error: declaration shadows a variable in the global scope [-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é Reviewed-by: Eric Blake --- 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; } -static void add_user_command(char *optarg) +static void add_user_command(char *user_cmd) { cmdline = g_renew(char *, cmdline, ++ncmdline); - cmdline[ncmdline-1] = optarg; + cmdline[ncmdline - 1] = user_cmd; } static void reenable_tty_echo(void) From patchwork Wed Oct 4 12:00:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 729291 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a4e:0:b0:31d:da82:a3b4 with SMTP id v14csp303508wrs; Wed, 4 Oct 2023 05:03:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFoTd4JwsYT29RxG/hbqDWRXd0CiPQy6RS6HjxRYEEdSv2+WN1StCSjITc9+1QHClxqN7dO X-Received: by 2002:a05:622a:1cd:b0:418:221a:b51d with SMTP id t13-20020a05622a01cd00b00418221ab51dmr2275959qtw.58.1696420999988; Wed, 04 Oct 2023 05:03:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696420999; cv=none; d=google.com; s=arc-20160816; b=VmUkCaYiDVqKQeBZu39U7rgLgnN1C0iYAOuRjNXtYV/BHCZVObIoTmF4Ly5bvMpBmn rIrCzxWV7lU3aIG9gHOauWC+51d4KUF0odXflpR+4KqP21wgpkSwI7hevwJO/+bp27vM ysH242OD1YTt9xQNB2URxlGFZAlGCjbQ8mYP1HYNdFffETPqbkRKfKfy06l94JIODE59 XryMuNmZGsKJrchuMxdcMmk/jxlm86bTsnlX3mRGIkF5IwtJdSZevZe4VAWeHaGCqor8 KwIHqcIchWpQKjCyYzrj14GC4x9bVqVlc8pMjq7+fqY6tEhokndaSD3lLSCtb04vGG6H Mreg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=dSsZst+VBCRAXvBcctI1DdSiyNeof1zy8WHkK6DbNv0=; fh=CiPLL5e3/ksjTnBI3lu3Xe3ed4FiET3DOCqevTCfsLg=; b=svGvJiFiRO9+lotZ2OWyAj2peklLYsGvfz/edxCwtdY4nOG82Q7ATouZiqA14KjM40 DsnRYlC8x2OosbNgwFyfUA70NVbTvqmaF2AcVkaUSc8CwUITeOH6I/vpYyTD3CZM2cVa +hn8tFk317hGSnCe6FNzGX6iGYt4Rl9xi5jT6D0EnN+2BxI8D3pUCwlWyNvRnCtzAenO Cdl55ycVN8FbPno+RCZpNv2FnMeBBNQZYj5/NjxN7rNxCc2cwgBhwilS4+cQQ4ydpL47 JTVuZpA7IRr2PCrbpvx00MEWOwb15fsdssC2h33gwIt9k1bOK6pc8cttxRAvw1oztSJz I0mQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=W0kQUSP1; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id t10-20020a05622a180a00b0040f07863f74si1422777qtc.252.2023.10.04.05.03.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 04 Oct 2023 05:03:19 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=W0kQUSP1; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Markus Armbruster , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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é --- 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_interfaces.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, Error **errp); /** * 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 is 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); /** * 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 *optarg, Error **errp); * Returns: true when an object was successfully created, false when an error * 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); /** * 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, Error **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); /** * 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) } } -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 *optarg, Error **errp) Visitor *v; ObjectOptions *options; - if (optarg[0] == '{') { - obj = qobject_from_json(optarg, errp); + if (str[0] == '{') { + obj = qobject_from_json(str, errp); if (!obj) { return NULL; } v = qobject_input_visitor_new(obj); } else { - QDict *args = keyval_parse(optarg, "qom-type", &help, errp); + QDict *args = keyval_parse(str, "qom-type", &help, errp); if (*errp) { return NULL; } @@ -295,12 +295,12 @@ ObjectOptions *user_creatable_parse_str(const char *optarg, Error **errp) return options; } -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; - options = user_creatable_parse_str(optarg, errp); + options = user_creatable_parse_str(str, errp); if (!options) { return false; } @@ -310,9 +310,9 @@ bool user_creatable_add_from_str(const char *optarg, Error **errp) return !*errp; } -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); } From patchwork Wed Oct 4 12:00:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 729294 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a4e:0:b0:31d:da82:a3b4 with SMTP id v14csp303910wrs; Wed, 4 Oct 2023 05:03:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHItocHuVpGMZiHzsgqzNQdrLkmb2zZBQwxKJVcaUkyr4wFNn4R0m3LdQD5UhPvv2qPQYKP X-Received: by 2002:a05:620a:2885:b0:76d:bc1b:c491 with SMTP id j5-20020a05620a288500b0076dbc1bc491mr2303378qkp.14.1696421033861; Wed, 04 Oct 2023 05:03:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696421033; cv=none; d=google.com; s=arc-20160816; b=njddXN4EpNGvXRZJ/ssROjX/VN4jaDwBDzJyJgbQXDadVAGoqSylCXJuv8sGHwyCDv Q9CTCyu7jP3Rnf13/8dNaXrgJZkPHNraKgI96L5XqGHTOzf9AsHYuxdkCLAvR2PcIDBD KMZAfEu4NnPbf4hcG+aeeEt90KDoW3+waDF3C2miRvrZzZzxWhYn76nYSlHU8wamJ+Ih CpfuNizkBy/fy7ohMT6zykaiYi5xHtoUirLou3XAuwFQDqpSL8Tss1HDJPCvXJKyDdo2 rgqhgO9GA3oBM9G210+oc+eMGZ3ujYHGTTkEXFLSvzgf4b4eT+m9DukyCKJ3m1Ez0/uR 0Kqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=lY+2ZyI4HgMHia8dRE1/FWk+2Dlndzg7wEwrT1ttBuw=; fh=WMIdhHxQOE06Q0CA6hatwIdbwD5GPL7+epgCEEyumco=; b=OustblIc6GeKPxrJQBBzUC/Ssyh3Uv02nndmpp7FfYk49eAcPl5W+si5Mir/ip3BA6 UXPg5C4fawQaum5K/N4SyPmjq0Nel2GDxKV+Uu43V6Ayl/UtAUMemcCm/tJRjYv1lET6 yJlObrhVP2UuPFlVld25yOkl4JcE25ZbkX66iAdR32Hxch5MMgbEv4HoT0FG17gtVAuB SsOYbnKSWkaGzWVFSnTWaQMTg/q8ZM8QsXeweDGz+92VB8xYxNESUQXEpKzRh1KAp0Y6 znxc5EINgZA9sDNmTCn/dErPnyyjqoevvdac0XKtwOv2rnpa+VPnGnOzSC9/VzgQRvOG bNUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=F2pYlKQC; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id oq5-20020a05620a610500b0076f18ae10e1si1361385qkn.395.2023.10.04.05.03.53 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 04 Oct 2023 05:03:53 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=F2pYlKQC; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Markus Armbruster , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Alex?= =?utf-8?q?_Benn=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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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é Acked-by: Alex Bennée --- 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 = SEMIHOSTING_TARGET_AUTO; } -int qemu_semihosting_config_options(const char *optarg) +int qemu_semihosting_config_options(const char *optstr) { QemuOptsList *opt_list = qemu_find_opts("semihosting-config"); - QemuOpts *opts = qemu_opts_parse_noisily(opt_list, optarg, false); + QemuOpts *opts = qemu_opts_parse_noisily(opt_list, optstr, false); semihosting.enabled = true; @@ -155,7 +155,7 @@ int qemu_semihosting_config_options(const char *optarg) semihosting.target = 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; } 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) { } -int qemu_semihosting_config_options(const char *optarg) +int qemu_semihosting_config_options(const char *optstr) { return 1; } From patchwork Wed Oct 4 12:00:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 729302 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a4e:0:b0:31d:da82:a3b4 with SMTP id v14csp306826wrs; Wed, 4 Oct 2023 05:07:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGAG3TZeJ5/DnglD30yS11iZzA4QYEg7iczDIVaguNuCA7IPU94FbrVU/Vsq8J/ggjVl8xv X-Received: by 2002:ac8:4e4d:0:b0:418:cec:5e64 with SMTP id e13-20020ac84e4d000000b004180cec5e64mr6287362qtw.19.1696421256338; Wed, 04 Oct 2023 05:07:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696421256; cv=none; d=google.com; s=arc-20160816; b=vvf9/uLO03S6Fv72dhxeTIkqHo3fBVooDn+Tw9U0XjAq7VIuBUYXUr3ODJT5glDmdS jtgXe2CiYk7ezFue7zJKNxNa09KuDvBbhzdR51HMaSpPW15G9qzQqn8ApHUGwb8GoPAH S0GfZuu+lO1Yk2D1ZgDYOlL8Hjx6StHlDium13ONDazyc8JIqQMhrAMOHLABQKq1GUti c/bAmgxYciZcWvPo7BiGAQOa1QWmlqQ2o/EYi5NB9YBknjw3Sy4F7MTg6vT1UX+JqOgM LLRXG7Xq9p1l36GpKJJBVclD0m7QIAv1BreYBnJ6hmi1wge8oD3MLocNjU2X9c+mxYUr gj8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=aaBKBsLGQ/LuJm7hrK1IdnE8JEzy7Etr5v11yBfp1ug=; fh=gOpA6/6ZuSmOui+n+DbgZwufog7HYp17sbowUCtwixM=; b=lwctYJkjBNlA8aSrwNINQ8xla7kky0ik4+NItZjPoZwDHndIh6/1dEFUIxq7NdDhyd NRokH2fVpDwnvzO5GvTvsffEZ3M9vns/OP0lnrqn4CTyiM6/8kfULEuHGc+0inkZczZr woPd/6HOb30bOxY4bR7FM9U2PjtUxaYYeTTYXoYgTEbONOP8dRxt/QzKvTTuTsU7QjGy nMk3BzCivc4BAsv+23PGWjLwDmMb5qhIG7KfMahciy8tmEVq0rtZS0EOtqqOt2oSF8Ui nrIzGIIYaBmkqmimIkUWE4twu+2Nxnyxik8S9SaCcVZzIEljDooxk3sAy2ldNWRQralR m/Ag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Rfm1la5s; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id l5-20020a05622a174500b00417d687ab03si1408973qtk.696.2023.10.04.05.07.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 04 Oct 2023 05:07:36 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Rfm1la5s; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Markus Armbruster , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Peter Maydell , Akihiko Odaki , Gerd Hoffmann , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= 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 Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=philmd@linaro.org; helo=mail-wr1-x42f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Fix: ui/cocoa.m:346:20: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] QemuCocoaView *cocoaView = userInfo; ^ ui/cocoa.m:342:16: note: previous declaration is here QemuCocoaView *cocoaView; ^ Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Akihiko Odaki --- 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; static CGEventRef handleTapEvent(CGEventTapProxy proxy, CGEventType type, CGEventRef cgEvent, void *userInfo) { - QemuCocoaView *cocoaView = userInfo; + QemuCocoaView *view = userInfo; NSEvent *event = [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; } From patchwork Wed Oct 4 12:00:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 729297 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a4e:0:b0:31d:da82:a3b4 with SMTP id v14csp304788wrs; Wed, 4 Oct 2023 05:04:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHQPyPCG/pc6l97tp2vFLCBKL0gNIQAAZgnB7Pmjbmiw2eHIoWURdbYJ26jke3jFOHObaXr X-Received: by 2002:a1f:4887:0:b0:493:3491:ce89 with SMTP id v129-20020a1f4887000000b004933491ce89mr1427679vka.14.1696421085185; Wed, 04 Oct 2023 05:04:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696421085; cv=none; d=google.com; s=arc-20160816; b=T8XbX5C2Y7rlkc4mwbnLOkA/1hBNrYyXXzM+X0sOgFDRs/BxoXiivg6iVW43N8gGyo w3beGF7KfkfUhjW8fbkqHb3E/wa1tGL/tXDe8vnbvmFJhcgva8fdsXHXyICSDO7l9SFs b8fUh6y8oFPOBsMMErra1o4afYWxKUgt333BKO4yXo1bs/gxPmJI20OOG5w9ofaI1U9d kwEIFLRWcffhDuVzrsZIfPLOQFSu9QcQFcKQmme2dr8tqySADG1yStgTbwGo4hP+dmx/ GOJDb3l2Tv1m7p52xBNYXpBg5Y+Ng6hSJa+o9DJterCpefcWlyrjyW7Z9NUTgdnS9b/n ejeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=9QTZPnGa7dzlAxYI3K0r+uL7KCteU3g2TmxdKpGNVN0=; fh=wOOH2wy3sHyPLjvJJJsdtILmIpS3E3TykE4s3MhiAsQ=; b=j5R7ksf+KqBGJS9j2aink4J/G+Mwvs1RKhQ+ygQKtz4c330jbh0uA9L2iZvsqzBJB9 KS6Yui+Pvw3RGlmizVxy6UQND0bbTEX8N6TcpSWxW6ky72J83QFgTMJkE2ky9VuHcrFx vEBmOwztdcVbB7AcZVqiSpMVL4IEqJk0x+WbwzoGH7a8PgKbyZFNVkaAYYIFeydqnF7n v4ilSfen7Sfud4Xt/DsBNlqOmI3rawtywIUyydKT6pSP2tA2EqIm5fBu74KjLwZ7lZjP baZcptpcQcukrkNNWeLRCdAiGj3kWVwsbomq2f/owAGTe5iyKgDOCfmB+5WkQBzeShP9 9Nsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AFm0zfRD; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id i8-20020ac5cd88000000b0049d12298590si248201vka.252.2023.10.04.05.04.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 04 Oct 2023 05:04:45 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AFm0zfRD; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Markus Armbruster , Thomas Huth , =?utf-8?q?Philippe_Mathieu-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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Fix: util/cutils.c:1147:17: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] const char *exec_dir = 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é Reviewed-by: Eric Blake --- 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 = strlen(CONFIG_PREFIX); const char *bindir = CONFIG_BINDIR; - const char *exec_dir = qemu_get_exec_dir(); GString *result; int len_dir, len_bindir; From patchwork Wed Oct 4 12:00:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 729301 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a4e:0:b0:31d:da82:a3b4 with SMTP id v14csp306780wrs; Wed, 4 Oct 2023 05:07:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGp8PDAvsN1n6C6slXgIwtld1wdfx2/219CBZMgFPYKeYYZcOhWHQo52PjinL4Suge2yISE X-Received: by 2002:a05:620a:191a:b0:76e:f5c5:1bac with SMTP id bj26-20020a05620a191a00b0076ef5c51bacmr2365535qkb.48.1696421251956; Wed, 04 Oct 2023 05:07:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696421251; cv=none; d=google.com; s=arc-20160816; b=FUXUt+Ia9ImQeL4oVi//zKyRKs9OokISjGxYOsRp7YhuGdYxjB09kfWcWXwlC+AYYZ FLtiXLWbYI4L0xRZemPB40k8wLok28ncy7PSpXDkQ52WahfIrJvzWqBPG97ZtuIfidbH EhZrVFY+d/kzqR8oRgS1dDNZPF72otaiyYIXlT/KvGdxYXoueIMpNfVospOnKKjJtkoS 5TpMbrpYECdpoWFBcnA82gFbwSAduTlVXmTkl/ufbf7Ur//n4wwxQkoQFAECmn2oEZ+8 LDCSOr3vhZ4vVVc0FucVtZGypR9MGvckJEFvcVsNyuBpssXYfjSP9UulGLTkRI/WJu17 +XEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=8JtBXMzpsFb0+ye9vGJHcom9MCYcPPJwy9i7R/QePcg=; fh=wOOH2wy3sHyPLjvJJJsdtILmIpS3E3TykE4s3MhiAsQ=; b=Pht/fVCNBkZWfHVoTXqzSi3se1nsBOXpIO3NOdeMjvXF0xhLC57KmLgQeUUTdbeMAA /ae+8/zWUJjpSR9KMZFwMQ62UY4yT4hMaDcNir2JNRFEfASd4FzQ3gaj2lZkeglGl081 JC/el5sTh0xwVkcsoNPxBKOLMx3SaxhPQU0P3QegTYkwu6qJXzU4qL7NgfvEXylZhKeH DkpfCfmwV4zexhAQX0jF4mtanOOtZLN/OZ5FGXZI5VJkeC5iiRDiKaFxUQd2VkCHXQm9 +E2R8dNAxiYbbJtCYTFdjoW0IVD1Z/xgyHR+pjYp3f1pu7OhzyZ5NHtBU7khcy6RiMMs qUiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZAJIIhDL; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id bn36-20020a05620a2ae400b00773d6fa3fddsi1392929qkb.377.2023.10.04.05.07.31 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 04 Oct 2023 05:07:31 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZAJIIhDL; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Markus Armbruster , Thomas Huth , =?utf-8?q?Philippe_Mathieu-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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Fix: util/guest-random.c:90:45: error: declaration shadows a variable in the global 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é --- 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 /** - * 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); /** * 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) } } -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 = true; From patchwork Wed Oct 4 12:00:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 729303 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a4e:0:b0:31d:da82:a3b4 with SMTP id v14csp306924wrs; Wed, 4 Oct 2023 05:07:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHi8LxgdTR9IJAvxdCPECw3DWR+hI4cajvT91ZTwk7AC/ubSbXQGcoDRr22YyD5dzkSCfOq X-Received: by 2002:a05:622a:1d1:b0:417:b91b:e101 with SMTP id t17-20020a05622a01d100b00417b91be101mr2436915qtw.21.1696421265230; Wed, 04 Oct 2023 05:07:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696421265; cv=none; d=google.com; s=arc-20160816; b=grf18Spqd3zMT0PzyWJTCnod7CYp8Vij6S2cO2hedODXvkTUWN0KriPLfgHuUmzUEI qmupUy1Xi5s5tr6pH2LR65+2nPfffi+Rw7NZPgdCcz/FSO7GgTkkPtphBfgnq042bjYN wOtmcLZ8S069Cv27ftYsMH5NPeKwjMzRayglIokLOE0zggwxwmboJqfgDYFCGLs9SYre r+HMU57Qe6WRqx1DwfypUT3rJ0DYE7t/882ThPDhD7BorU5x+OYZRkNmcTWJ79xvLKoq IEdgv2u8hGMIDMLc3LWsSypMqPUs7Y9HylULpzMi1xJJ04KLijlJzgmHYx790dNKu/eE MGZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=S8wZ57nmGBju5vDKBp5SHeeONo30+tUOfUJLJWu5rBM=; fh=WqqjBKdRofj4eRAnrlE6cF/DwtqWEYNnnEv6JjVp+gM=; b=eP0DVLSjiHmv+YqzUYqqDIReKBMEL/a/BS4U2RBQyunl0ClnHgT8jwzwWgMl6o353m +4T1OPn03tx5slGpZZYTdgFTGBaJHs+A81VBMNefrEAx5ppfCTUFZDVfxhaaSTWEHk7N P6lblrImbwc9KqCRGXzyJZbS4IxKo0+OV4aFQtwvNhIO+czU6oIAncmT4Wo75fvf4er3 UUFXO555FuPbHq7HgQ7BlNmSAnDbQ/j50/8ACJlaWVIaI02tZmMgpwfFBHFui2Lr89nF oydEcGyrquPA125SMgqHrANsgxFntADKGLBhrI8h2AFOKOJiupjnMFMrMhJ9D3wT2fPi I2nA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ASPt7McQ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id m7-20020ac85b07000000b0041821adfb01si1414950qtw.632.2023.10.04.05.07.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 04 Oct 2023 05:07:45 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ASPt7McQ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Markus Armbruster , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Alex?= =?utf-8?q?_Benn=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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Fix: semihosting/arm-compat-semi.c: In function ‘do_common_semihosting’: semihosting/arm-compat-semi.c:379:13: warning: declaration of ‘ret’ shadows a previous local [-Wshadow=local] 379 | int ret, err = 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 ‘ret’ shadows a previous local [-Wshadow=local] 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é Reviewed-by: Alex Bennée --- 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; nr = common_semi_arg(cs, 0) & 0xffffffffU; @@ -725,6 +724,9 @@ void do_common_semihosting(CPUState *cs) 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); + } case TARGET_SYS_ELAPSED: elapsed = get_clock() - clock_start; From patchwork Wed Oct 4 12:00:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 729295 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a4e:0:b0:31d:da82:a3b4 with SMTP id v14csp304200wrs; Wed, 4 Oct 2023 05:04:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFjIum95P+vL/fg5wnvvoFlnVIqZmQMK5U9tQEEzYM6H9ubeCc+mEfZrRXYnPXDi446ZOBZ X-Received: by 2002:a05:622a:1ca:b0:403:abf5:6865 with SMTP id t10-20020a05622a01ca00b00403abf56865mr2152355qtw.18.1696421051863; Wed, 04 Oct 2023 05:04:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696421051; cv=none; d=google.com; s=arc-20160816; b=yMm0EIiEbj7SkT4j9Utz6XeJhytsCWcSKdrGTDUIBpDKHhkityntpaZohf/NHBgZdj HaIWbS8xyerFZ05P4P9/ePyzDF+rknGvh+bodWBYp5V09jaRKR0yktDhJmPY1u6ivLDt 91hGxeJupNE6oa8CyU6roXQUsIO/5iCFhn3vtiwDKg+oQ39tBQgOj8IEOIsAIpItZOLJ SqLU9CCfj7JoMkfhUgqRbIZZUocMCgz7elLDCkkyeGT9OF3kavPvinVMOC9vERcGnLX7 mDuqMqJ4N8nzDJWuJfgv+Embqs5dVtw6ujeZmdV3/cpCrlZYOUYt5T0p+iFgjr5m+6Q5 o7hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=VbE/h6HUxHm1fKUuktISJWotuykVg/wSDPAOtZyCrGc=; fh=DGsemwhdqtom3k1xyp/Ay3eBo/+/1/cVk5wggzCgk24=; b=dssishoMzAXxi5ypm+0kbJzxM0mU7Z8BnJiYxqDEqLQIfEPKgwXSosIvkKyp6MCvh+ sV4vhqqKY6sFgiBW8/SofG8L00WgDn0TRQkUnvcYhZu4Jh+RiOAFA2gi5peQCnxKYJPQ rHANDT8iL3LvNbYAj2BgqFedxO6Hy7wC9Ja3JxTM8WUGeTmLOLrhrwM555YyQVZrVbHX XNDQi1dhvRnWV8wrtOH+klncSnFVBcV17ijCXW6ThQ3Uml0NeqRJolRQE94NXclrmQlO 7RtKI7Sxw8P5RZwMwf/46jQHQm8I08rywU0NaFwhCR1Gocm1Qr9wdTCZ7Cy5b6m49tFe AJww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hdDcmOio; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id j8-20020ac85c48000000b00419661408acsi1437967qtj.347.2023.10.04.05.04.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 04 Oct 2023 05:04:11 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hdDcmOio; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Markus Armbruster , Thomas Huth , =?utf-8?q?Philippe_Mathieu-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 Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=philmd@linaro.org; helo=mail-wr1-x436.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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 pretty) ^ softmmu/vl.c:1634:17: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] const char *optarg = 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é Reviewed-by: Markus Armbruster --- 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 *machine_class, const char *p) } } -static void parse_display_qapi(const char *optarg) +static void parse_display_qapi(const char *optstr) { DisplayOptions *opts; Visitor *v; - v = qobject_input_visitor_new_str(optarg, "type", &error_fatal); + v = qobject_input_visitor_new_str(optstr, "type", &error_fatal); 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 *opts, Error **errp) return monitor_init_opts(opts, errp); } -static void monitor_parse(const char *optarg, const char *mode, bool pretty) +static void monitor_parse(const char *str, const char *mode, bool pretty) { static int monitor_device_index = 0; QemuOpts *opts; const char *p; char label[32]; - 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 = qemu_chr_parse_compat(label, optarg, true); + opts = 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, static MachineClass *select_machine(QDict *qdict, Error **errp) { - const char *optarg = qdict_get_try_str(qdict, "type"); + const char *machine_type = qdict_get_try_str(qdict, "type"); GSList *machines = object_class_get_list(TYPE_MACHINE, false); MachineClass *machine_class; Error *local_err = NULL; - if (optarg) { - machine_class = find_machine(optarg, machines); + if (machine_type) { + machine_class = 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); } -static void object_option_parse(const char *optarg) +static void object_option_parse(const char *optstr) { QemuOpts *opts; const char *type; Visitor *v; - if (optarg[0] == '{') { - QObject *obj = qobject_from_json(optarg, &error_fatal); + if (optstr[0] == '{') { + QObject *obj = qobject_from_json(optstr, &error_fatal); v = qobject_input_visitor_new(obj); qobject_unref(obj); } else { opts = qemu_opts_parse_noisily(qemu_find_opts("object"), - optarg, true); + optstr, true); if (!opts) { exit(1); } From patchwork Wed Oct 4 12:00:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 729299 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a4e:0:b0:31d:da82:a3b4 with SMTP id v14csp306543wrs; Wed, 4 Oct 2023 05:07:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFXJQxncbl+lG4m5VNaqUD+LUXoXNMVAyAZJRFSpcag+6Sm6OeXxipe/MawLISc23O6wR8Y X-Received: by 2002:a05:620a:94e:b0:774:20df:8b3e with SMTP id w14-20020a05620a094e00b0077420df8b3emr1780029qkw.78.1696421228173; Wed, 04 Oct 2023 05:07:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696421228; cv=none; d=google.com; s=arc-20160816; b=nwN9A54GR/Jz2uHl9lzkWqH8zCQAV9qG8s6i1mCZVsgF4Rqyv3eGjtK2l25r1l38No tU4sYi+tKaoGCWnzChlMlzBH4uTri9VCXzijeqclP15/QHtm9/eIJbomoJo6EqqwL6JA rHKi1Q7jMHgG5XztjlVXtZCgAoF6oIJqRmHENw6QXpmHK410piEJHCKmTRX9JsPxnxqn WjwTrIKVDnBAsuxnQJa+74uoIulpssatUg2a4q2fb3rvaIPVqjkPMWc0jiq2QDGwfshk TBMZwmYYT1tLwRxWQjdi4DKcw1GNqPmpryoontR3etGE3A0Tt5hp5+G3LhiCUj1BZpev 1M7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=JFR7669aVf4KyLNHSFRJbfPNWIK7DIVGhVdjQEp6ZNY=; fh=jfRYN4aiFAE7ExcaoFO92tMACfi46HllWFD6tPlB+Uk=; b=S3Oao8yzLBMPylfxuJkeekA3zojXOgJmAM5UoqYGAZbIxYo6i13uYhZVKfA5jovSCa Fc0AjtV9X2ZlLvJJxWmDKn6M1abqISr6MtwKnnJ3nX7kxVz9I0KPhRYz8/Wn7tqc/AbP lYV883T32Yj5JdfOZqw4fPc10VjudwoGpAWugor9Zx1n8hSJKSnoa5a2EeFB0bNYxToS NKj+gM73ED3o9njocvlCuBwAnFNJNfBDWjjDv1LYVK0lbcoLjmHe2B+qUc/RAiNpeXkv +PXXemDabVulBD4L1c4jJJZdpEHWB6cpWPKc5h+s3fXWOMNk1tUIQAn2E8V+Q9EV+VEA nfAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=c410cBri; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id s14-20020a05620a254e00b00775719c51adsi1404071qko.667.2023.10.04.05.07.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 04 Oct 2023 05:07:08 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=c410cBri; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Markus Armbruster , Thomas Huth , =?utf-8?q?Philippe_Mathieu-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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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é 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 @@ #ifdef CONFIG_TPM -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); 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; - if (!strcmp(optarg, "help")) { + if (!strcmp(optstr, "help")) { tpm_display_backend_drivers(); return -1; } - opts = qemu_opts_parse_noisily(opts_list, optarg, true); + opts = qemu_opts_parse_noisily(opts_list, optstr, true); if (!opts) { return -1; } From patchwork Wed Oct 4 12:00:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 729300 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a4e:0:b0:31d:da82:a3b4 with SMTP id v14csp306731wrs; Wed, 4 Oct 2023 05:07:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGHku9mRY+drzcl9rl0fazrOFsh8I3Q6XQWP6pUoVDalv/zWLi8dRtN1RZ6KIZPvu6d9RKR X-Received: by 2002:a05:622a:20e:b0:416:4cc5:2f51 with SMTP id b14-20020a05622a020e00b004164cc52f51mr2262763qtx.1.1696421247557; Wed, 04 Oct 2023 05:07:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696421247; cv=none; d=google.com; s=arc-20160816; b=iNKvo6BeJ7EA2x35IqwM34LsZFEDqEt5wR2AqJ5t+RYcDhZkPKybI4XdGa8ECYmSjU 2zudBFizDupwTUr7SRYyh5nNIcaA/5W1d0lJXS0hyg4xY7jquGKYAcSHEsGPJbS/9k4F lh+s6cqqSi+LYizMBo5H83T7vq7/pjEvgbopAA6floaZ4ENFXL/99IkUKS+Zj6dhI+EN dLlwm8TxrvkjECFQtfAHhGVAeZDxsVH9mEf4fHg8hbpca/ASQbFupKqseEkHAJstDEEj 8ZkBX+l3ziw6nu067h5EfKAx50XfogwKeidCwpyqqbdm9fqWCuhBhB3BJg/NwLQzPFe1 +/kw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=bBGVE0DoG3fp73QBVo0q6OJfPVhOCAa/aXxiQ7+SOqM=; fh=uO0JJ/V5EcOCNYyIOsNShklzWr2MWwE/rsKClRIBwPs=; b=NA7ANnblcjOqgefF74orUlyzchoppWuR5ZkNGeK331r1TtrFO06fJPrjLzIIdMCyGJ QC5OuGr0JrmWInXJHolrb0sBZdX5xrioa5gjP8nQWI0BWslLdvYOX89boWX87fGGU6Kq evtwneAca6/nDM71fCwNmSU589UjGo2y99jsT3jqlfE4rfQ2UkYEaF1+9Z5bY/m7SfLq LYEbhoIqawuEfV8lAGSRnr/DR01PDo6CFRdvMRPTAonzwvHFf86BVVPW2zd8++3Y9SDC sOwOdtTKNEehbNScBtX4J0sn0fkg+oD5T9D1/ap+UqnrAVbzpmddJ65TAhCbUS69PfwC W5TA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TE5CK8a9; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id t8-20020a05622a148800b0040345635f05si1414013qtx.132.2023.10.04.05.07.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 04 Oct 2023 05:07:27 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TE5CK8a9; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Markus Armbruster , Thomas Huth , =?utf-8?q?Philippe_Mathieu-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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Fix: trace/control.c:288:34: error: declaration shadows a variable in the global 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é 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; /** * 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); /** * 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; } -void trace_opt_parse(const char *optarg) +void trace_opt_parse(const char *optstr) { QemuOpts *opts = qemu_opts_parse_noisily(qemu_find_opts("trace"), - optarg, true); + optstr, true); if (!opts) { exit(1); }