From nobody Tue Nov 30 14:31:32 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 2AAB618C737E; Tue, 30 Nov 2021 14:31:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J3PmN69Cjz4kb0; Tue, 30 Nov 2021 14:31:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B48F417CC6; Tue, 30 Nov 2021 14:31:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AUEVWV4090801; Tue, 30 Nov 2021 14:31:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AUEVWqg090800; Tue, 30 Nov 2021 14:31:32 GMT (envelope-from git) Date: Tue, 30 Nov 2021 14:31:32 GMT Message-Id: <202111301431.1AUEVWqg090800@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: b394e16ef0b5 - main - fw_stub: fix -Wunused-but-set-variable for firmware files List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b394e16ef0b5ad0da5e029bcdd3a01e361724d8d Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638282692; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9TXQ4Yf8sleM5DF15JefuSgmYxviatlQrO4Gbirm59w=; b=B4Fzy/4p2Znv/sl4821M/i1xRpyynIeZuZ4eH/cwdVc/MXBUnYUxr6aAh2pL4DcN08vwys inEPkAAqL0gHTrtF3jUAxoTKnjgkvHxn+GBf0L5/kmZjGTnhmMwmRtQA9L1LDB7+RkcYpR 1JngrWkAe/nnZXgcaHEj+eV8ERNozr2kvBQ4MrflSzYyoA7Pq3PYK2Mk4we3rDy5tgAmfT vF2m/ViZ5YLGvOiSP04QVrWs2/tq+QQ/kAIyBrWWPy8me0Bz6F4vf31qYV2QkKlqqzTcY3 SYVJ7KdAdGaVbL3lDeQ9voVk75e39UgyFII9U2lVYdya5/mBq4zEhSkWDlWohg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638282692; a=rsa-sha256; cv=none; b=KURPhyFFkmlLghLQztvpeFzy+UvDwikuil5Yon0aAUW/m2xopeH20Z3J1YXZzLVo2nQWLw vMIAeiaUNzZiGdf7eGFFizwA0mwHf6WMtzDP1vNR3artBVsgslov+r4lP8YwNLjjeu0YzU UuRovP3ftWf08wsvIl4qPRP4Z/eptHZwdBUNsZfFRJq1eHyvAeuk8hE9qvmZSzGP/hkTTy s1yf3SDLMxhPZZvs1xgNKwhGv9ZUZ9COtYC5UiSrzOsxLPSgL0fJNMiKjRzUgEPK13rv2o 3a0cow6XJ6pnDNvquoYanNpleSB57hNpA9hW0KXqy4soM++H28P7qHFEGVGGpQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=b394e16ef0b5ad0da5e029bcdd3a01e361724d8d commit b394e16ef0b5ad0da5e029bcdd3a01e361724d8d Author: Bjoern A. Zeeb AuthorDate: 2021-11-30 14:23:18 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-11-30 14:23:18 +0000 fw_stub: fix -Wunused-but-set-variable for firmware files In case we are only embedding a single firmware image the variable "parent" gets set but never used. Add checks for the number of files for it and only print it out if we are exceeding the single file count. This fixes -Wunused-but-set-variable warnings for the majority of firmware files in the tree. Sponsored by: The FreeBSD Foundation MFC after: 2 weeks --- sys/tools/fw_stub.awk | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/tools/fw_stub.awk b/sys/tools/fw_stub.awk index 807c51b6190b..94975687f4e2 100644 --- a/sys/tools/fw_stub.awk +++ b/sys/tools/fw_stub.awk @@ -151,8 +151,10 @@ for (file_i = 0; file_i < num_files; file_i++) { printc("\nstatic int\n"\ modname "_fw_modevent(module_t mod, int type, void *unused)\ {\ - const struct firmware *fp, *parent;\ - int error;\ + const struct firmware *fp;"); +if (num_files > 1) + printc("\tconst struct firmware *parent;"); +printc("\tint error;\ switch (type) {\ case MOD_LOAD:\n"); @@ -187,7 +189,7 @@ for (file_i = 0; file_i < num_files; file_i++) { printc("\t\tif (fp == NULL)"); printc("\t\t\tgoto fail_" file_i ";"); - if (file_i == 0) + if (file_i == 0 && num_files > 1) printc("\t\tparent = fp;"); }