Skip to content

Commit 90541f6

Browse files
andy-shevUlrich Hecht
authored andcommitted
nfsd: Mark variable __maybe_unused to avoid W=1 build break
commit ebae102897e760e9e6bc625f701dd666b2163bd1 upstream. Clang is not happy about set but (in some cases) unused variable: fs/nfsd/export.c:1027:17: error: variable 'inode' set but not used [-Werror,-Wunused-but-set-variable] since it's used as a parameter to dprintk() which might be configured a no-op. To avoid uglifying code with the specific ifdeffery just mark the variable __maybe_unused. The commit [1], which introduced this behaviour, is quite old and hence the Fixes tag points to the first of the Git era. Link: https://git.kernel.org/pub/scm/linux/kernel/git/history/history.git/commit/?id=0431923fb7a1 [1] Fixes: 1da177e ("Linux-2.6.12-rc2") Cc: stable@vger.kernel.org Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Ulrich Hecht <uli@kernel.org>
1 parent c389f11 commit 90541f6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

fs/nfsd/export.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -880,7 +880,7 @@ exp_rootfh(struct net *net, struct auth_domain *clp, char *name,
880880
{
881881
struct svc_export *exp;
882882
struct path path;
883-
struct inode *inode;
883+
struct inode *inode __maybe_unused;
884884
struct svc_fh fh;
885885
int err;
886886
struct nfsd_net *nn = net_generic(net, nfsd_net_id);

0 commit comments

Comments
 (0)