From nobody Fri Jul 29 18:48:38 2022 X-Original-To: dev-commits-src-branches@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 4Lvc3q2BJCz4Y2BG; Fri, 29 Jul 2022 18:48:39 +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 4Lvc3q1bRVz3tJb; Fri, 29 Jul 2022 18:48:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1659120519; 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=B2ScdrypZFPfQh6080ZWDFaKuGsY9cBYCWxdGn0D5vc=; b=oA+GAZaKaVar6s6oQvFrIwgN7DPVgUPvUvkeIxS3wxGNkMHjXlaa4Y/lEmWWkzrdaWABaA ibsLac///6oxK+OcX9pAZCMJ9G9sA2soKCyxxLzAtt2IXfS0Xx9nODwEYvBBIuysAHXj12 R+UPmZhf+1iRfeztwWMQSixgBfOl63PFpAPbJ4QHZQVrhplnsDeTA8rnK5plF4wjJdBQAx 3MOuaZ30Lcv2nYj0RAYsbSXhV8IIjgs+fd4HnhQkiO0iY2l7y0P1CUCm6cPYsT88fms4bo 3p/bNVAR9aNINrRv0UOeIubhbLe9p74ZCYmI7KGidJge8F8Ev9R1WIr360ODtw== 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 4Lvc3q0dMrzlvs; Fri, 29 Jul 2022 18:48:39 +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 26TImcrZ025652; Fri, 29 Jul 2022 18:48:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26TImce2025651; Fri, 29 Jul 2022 18:48:38 GMT (envelope-from git) Date: Fri, 29 Jul 2022 18:48:38 GMT Message-Id: <202207291848.26TImce2025651@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 6ef6d3424f15 - stable/12 - Fix unused variable warning in ffs_snapshot.c List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 6ef6d3424f158a797d280ebd3103d4d833d41230 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1659120519; 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=B2ScdrypZFPfQh6080ZWDFaKuGsY9cBYCWxdGn0D5vc=; b=FqGDUDF22WcNx15ims1LYU2pTp05NoNDXd0X/yk5cQNlbkRSSSqTdSXDW7ecj1tJCblkTk U+EW+tt/oLQBfVtYxVsI1oCrUY3OV8Z0d8jD0PgD0EKQKWebqr02uYGJOWQehE3bc/5GKt 8xpMmB/Wt07LKlJqNF+Bnyyw4UzL4KUb22QOwXbknf1AxavXEDkAb5wQzpFlyumPi6H8mE PtakZ8KLeoEosSNfOHhlC4NeOMSuJAvjMAUf8EVih3Zo+r2Yeu7LgsC8YUVTgXJM1V9tmW ui+b0PDczfTDc9wALNwkrhwkQBszHGw6myxmdX/xeEVOxoae+esDX9MXbRGAaw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1659120519; a=rsa-sha256; cv=none; b=MxBP4CVHM3kbltaGDJX2MHKbc8pP8H5OyIqHOi3rQuqEHT8XBNj0lj4j80V3nKYBrTTL5j zWAzwhS9C5c4kZHwb56qiRHVRXrLn8O5tYm1kG52r6U4z4oMSUDZOqCyxl92dDE5vS0T81 wqpSc4kkkP85dNMyW9sxDKIMVPcqsvOAPGG6N6Qxfj+oKXoNsP9WaUxoVKH5omxaR5lgDd kfWHcjIEZof6KxFnT6LZdAS90HzJQnJze2TkUQHxWFKmcSRsN/9gqEdLsofQ+bIj7eMK2T 6q5IuCsVWDF/+o6Bk5rz0WlpaJhgCOsLUph3kUGu0qGzf1YpzH4l+4kEGfbKxg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=6ef6d3424f158a797d280ebd3103d4d833d41230 commit 6ef6d3424f158a797d280ebd3103d4d833d41230 Author: Dimitry Andric AuthorDate: 2022-07-26 19:30:41 +0000 Commit: Dimitry Andric CommitDate: 2022-07-29 18:43:14 +0000 Fix unused variable warning in ffs_snapshot.c With clang 15, the following -Werror warning is produced: sys/ufs/ffs/ffs_snapshot.c:204:7: error: variable 'redo' set but not used [-Werror,-Wunused-but-set-variable] long redo = 0, snaplistsize = 0; ^ The 'redo' variable is only used when DIAGNOSTIC is defined. Ensure it is only declared and set in that case. MFC after: 3 days (cherry picked from commit c9dde6f0c713a027266c52cf94a33a086348c566) --- sys/ufs/ffs/ffs_snapshot.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/ufs/ffs/ffs_snapshot.c b/sys/ufs/ffs/ffs_snapshot.c index a65616fd04e0..1700a4094ae7 100644 --- a/sys/ufs/ffs/ffs_snapshot.c +++ b/sys/ufs/ffs/ffs_snapshot.c @@ -214,7 +214,10 @@ ffs_snapshot(mp, snapfile) uint64_t flag; struct timespec starttime = {0, 0}, endtime; char saved_nice = 0; - long redo = 0, snaplistsize = 0; +#ifdef DIAGNOSTIC + long redo = 0; +#endif + long snaplistsize = 0; int32_t *lp; void *space; struct fs *copy_fs = NULL, *fs; @@ -457,7 +460,9 @@ restart: for (cg = 0; cg < fs->fs_ncg; cg++) { if ((ACTIVECGNUM(fs, cg) & ACTIVECGOFF(cg)) != 0) continue; +#ifdef DIAGNOSTIC redo++; +#endif error = UFS_BALLOC(vp, lfragtosize(fs, cgtod(fs, cg)), fs->fs_bsize, KERNCRED, 0, &nbp); if (error)