]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 Jan 2026 11:57:24 +0000 (12:57 +0100)
commit433bb1344ef66cc071d7e1977744ef9b06a15c2b
tree93b6eb24b3e924d0f36cecdd5fc7d58d8184e62c
parentda1ccfc4c452541584a4eae89e337cfa21be6d5a
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
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfsd/export.c