]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
nfsd: Mark variable __maybe_unused to avoid W=1 build break
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 13 Nov 2025 08:31:31 +0000 (09:31 +0100)
committerChuck Lever <chuck.lever@oracle.com>
Mon, 8 Dec 2025 15:56:34 +0000 (10:56 -0500)
commitebae102897e760e9e6bc625f701dd666b2163bd1
treefcb0efc510611a5308feb9c678761fa5f17e2230
parentd1bea0ce35b6095544ee82bb54156fc62c067e58
nfsd: Mark variable __maybe_unused to avoid W=1 build break

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
Fixes: 1da177e4c3f4 ("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>
fs/nfsd/export.c