mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] fs/ncpfs: Fix a build warning when CONFIG_NCPFS_NLS is not set
@ 2016-09-11  9:49 Borislav Petkov
  0 siblings, 0 replies; only message in thread
From: Borislav Petkov @ 2016-09-11  9:49 UTC (permalink / raw)
  To: LKML; +Cc: Petr Vandrovec, Al Viro

From: Borislav Petkov <bp@suse.de>

I get this when doing randconfig builds:

  fs/ncpfs/dir.c: In function ‘ncp_hash_dentry’:
  fs/ncpfs/dir.c:136:23: warning: unused variable ‘sb’ [-Wunused-variable]
     struct super_block *sb = dentry->d_sb;

because NCP_IO_TABLE macro is NULL in the !CONFIG_NCPFS_NLS case and @sb
remains unused then.

Sticking it into the macro directly takes care of the warning and the
code is still readable. :)

Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: Petr Vandrovec <petr@vandrovec.name>
Cc: Al Viro <viro@zeniv.linux.org.uk>
---
 fs/ncpfs/dir.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/ncpfs/dir.c b/fs/ncpfs/dir.c
index 17de5c13dfae..f5b594e2457c 100644
--- a/fs/ncpfs/dir.c
+++ b/fs/ncpfs/dir.c
@@ -133,12 +133,11 @@ ncp_hash_dentry(const struct dentry *dentry, struct qstr *this)
 		return 0;
 
 	if (!ncp_case_sensitive(inode)) {
-		struct super_block *sb = dentry->d_sb;
 		struct nls_table *t;
 		unsigned long hash;
 		int i;
 
-		t = NCP_IO_TABLE(sb);
+		t = NCP_IO_TABLE(dentry->d_sb);
 		hash = init_name_hash(dentry);
 		for (i=0; i<this->len ; i++)
 			hash = partial_name_hash(ncp_tolower(t, this->name[i]),
-- 
2.10.0

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-09-11 10:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-11  9:49 [PATCH] fs/ncpfs: Fix a build warning when CONFIG_NCPFS_NLS is not set Borislav Petkov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®