From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754621AbcIKKSM (ORCPT ); Sun, 11 Sep 2016 06:18:12 -0400 Received: from mail.skyhub.de ([78.46.96.112]:51066 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752381AbcIKKSK (ORCPT ); Sun, 11 Sep 2016 06:18:10 -0400 From: Borislav Petkov To: LKML Cc: Petr Vandrovec , Al Viro Subject: [PATCH] fs/ncpfs: Fix a build warning when CONFIG_NCPFS_NLS is not set Date: Sun, 11 Sep 2016 11:49:55 +0200 Message-Id: <20160911094955.13861-1-bp@alien8.de> X-Mailer: git-send-email 2.10.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Borislav Petkov 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 Cc: Petr Vandrovec Cc: Al Viro --- 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; ilen ; i++) hash = partial_name_hash(ncp_tolower(t, this->name[i]), -- 2.10.0