lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20211203185816.796637-1-arnd@kernel.org>
Date:   Fri,  3 Dec 2021 19:58:06 +0100
From:   Arnd Bergmann <arnd@...nel.org>
To:     David Howells <dhowells@...hat.com>
Cc:     Arnd Bergmann <arnd@...db.de>,
        Eric Van Hensbergen <ericvh@...il.com>,
        Latchesar Ionkov <lucho@...kov.net>,
        Dominique Martinet <asmadeus@...ewreck.org>,
        Jeff Layton <jlayton@...nel.org>,
        v9fs-developer@...ts.sourceforge.net, linux-kernel@...r.kernel.org
Subject: [PATCH] 9p: fix unused-variable warning

From: Arnd Bergmann <arnd@...db.de>

The folio changes added a variable that is sometimes unused:

fs/9p/vfs_addr.c: In function 'v9fs_release_page':
fs/9p/vfs_addr.c:140:23: error: unused variable 'inode' [-Werror=unused-variable]
  140 |         struct inode *inode = folio_inode(folio);
      |                       ^~~~~

Make this clearer to the compiler by replacing the #ifdef
with an equivalent if(IS_ENABLED()) check.

Fixes: 78525c74d9e7 ("netfs, 9p, afs, ceph: Use folios")
Signed-off-by: Arnd Bergmann <arnd@...db.de>
---
 fs/9p/vfs_addr.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/fs/9p/vfs_addr.c b/fs/9p/vfs_addr.c
index 1279970e9157..82ac2ceff06e 100644
--- a/fs/9p/vfs_addr.c
+++ b/fs/9p/vfs_addr.c
@@ -141,14 +141,17 @@ static int v9fs_release_page(struct page *page, gfp_t gfp)
 
 	if (folio_test_private(folio))
 		return 0;
-#ifdef CONFIG_9P_FSCACHE
+
+	if (!IS_ENABLED(CONFIG_9P_FSCACHE))
+		return 1;
+
 	if (folio_test_fscache(folio)) {
 		if (!(gfp & __GFP_DIRECT_RECLAIM) || !(gfp & __GFP_FS))
 			return 0;
 		folio_wait_fscache(folio);
 	}
 	fscache_note_page_release(v9fs_inode_cookie(V9FS_I(inode)));
-#endif
+
 	return 1;
 }
 
-- 
2.29.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ