From nobody Fri Jul 29 18:47:34 2022 X-Original-To: dev-commits-src-all@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 4Lvc2Z6zdBz4Y1lP; Fri, 29 Jul 2022 18:47:34 +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 4Lvc2Z1n8cz3prf; Fri, 29 Jul 2022 18:47:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1659120454; 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=GTKs/XzixT/ihLL0yCtQlPkcvWXEwKMffrlK9FX39Ec=; b=NdQHT0B9O1ClOU3zvWF+jfGH4B9uh4+H6ls4xnYOHMnkYZbfdxCWu4twQ+ksd7IVAdi3CA Hb89E7/I2aYdHAnvXHh0VRFhgQEfrB8UFH8lGJnj4dvvxiThNd0lxhB71KU4tZQj9Jdmmg +YN24QApMTbmR9HSCWpX5HWSRtkh8sOhudHk5RkN5qtNKLkh0coCsJh2Iav0Pf4tT7IuzF bgvWOzizQM4Qk2CGMjIPUvyHMHJLMFQLivZDbfXwFKyJ59vvjo+xmMzlUZoZ86UwsjDz4l Ww+3pf6ATZXDCe/co2hH0/DbQbI1zaSSg3W/q10+6BkVGmMLpfjEpfAPXPQJeg== 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 4Lvc2Z0twNzmB1; Fri, 29 Jul 2022 18:47:34 +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 26TIlYLF024272; Fri, 29 Jul 2022 18:47:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26TIlYK7024271; Fri, 29 Jul 2022 18:47:34 GMT (envelope-from git) Date: Fri, 29 Jul 2022 18:47:34 GMT Message-Id: <202207291847.26TIlYK7024271@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: 1aa9b4e42326 - stable/13 - Fix unused variable warning in ffs_snapshot.c List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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/13 X-Git-Reftype: branch X-Git-Commit: 1aa9b4e42326ee695ad80719b935463ffcd0a112 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1659120454; 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=GTKs/XzixT/ihLL0yCtQlPkcvWXEwKMffrlK9FX39Ec=; b=hgahQJKbdoLIPU2thXU9E9vCZ5L49RPvEpPkaGKYnt2t67SsBZB2jGFTBn4qFTm12vx9va 5Idrjg6WcrnH1wMCcPOeXDyjhlEp1a9N9wyF21BGF1H/CQvswToToqa2/NxYFgn1338Zwa Gu0MUtdWDvudpBMPvQXtlrig44jjELr8cuen+SvZDylslFe0PeI0O51w9sl9o/A605aJ2o IPW3g6yjiOzDy+bKC+A60uIvjALKFEiXF13f/wvWFaH3RvCxG9PvkjHbw/n0fjy+NstJ/I qjbbh2G69yWWoDmL5XWaXTdFNxJPGzFvH3yMTInHJBC0JIHsTW3Ga7gs33h3VA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1659120454; a=rsa-sha256; cv=none; b=ZpXrLd3ZsCEwBgSYHtR4lCN0tKQ4mR0/RyzrwBUb793CqWQ+MmcjVHpIJoQhlJjDo9WKBz TsquVyVUwy9abIEGVhZvCFaTTYibAIenaTfjLairHz1TNa7CM/alhpW7WNrlZsTLWF0emP ZAPI83OB5rqTjeQhk5i5VY0/gUCn739WnI2QpA8JNWiNYv0BZwsnpVUy23CK0GLMHyrTko 7RSNL0RHxFwPDXMP3SqWKF8xJECkkJlKfE64fjzJDvZnMiWnMEUwU/byRZDcagoqttHK7J AesQzbhnLqnOueeuiNJ6Gu5iHarDhcAnpnt6BSqAxH170KhRBe54SgQ8iaQoDA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=1aa9b4e42326ee695ad80719b935463ffcd0a112 commit 1aa9b4e42326ee695ad80719b935463ffcd0a112 Author: Dimitry Andric AuthorDate: 2022-07-26 19:30:41 +0000 Commit: Dimitry Andric CommitDate: 2022-07-29 18:29:59 +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 5d5fb783e7d0..7cac1ec694a0 100644 --- a/sys/ufs/ffs/ffs_snapshot.c +++ b/sys/ufs/ffs/ffs_snapshot.c @@ -201,7 +201,10 @@ ffs_snapshot(struct mount *mp, char *snapfile) ufs2_daddr_t blockno; uint64_t flag; 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)