fs/ncpfs: Fix a build warning when CONFIG_NCPFS_NLS is not set
PATCH 1/1 fs/ncpfs: Fix a build warning when CONFIG_NCPFS_NLS is not set
From: Borislav Petkov <[email protected]>
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 <[email protected]>
Cc Petr Vandrovec <[email protected]>
Cc Al Viro <[email protected]>
--- fs/ncpfs/dir.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
fs/ncpfs/dir.c +1 -2
@@ -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]),
Signature · 1 line
2.10.0