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;