For CONFIG_XFS_DEBUG unset, xfs_trans_unreserve_and_mod_sb() generates the following warning for when building with W=1: CC fs/xfs/xfs_trans.o fs/xfs/xfs_trans.c: In function ‘xfs_trans_unreserve_and_mod_sb’: fs/xfs/xfs_trans.c:601:17: error: variable ‘error’ set but not used [-Werror=unused-but-set-variable] 601 | int error; | ^~~~~ cc1: all warnings being treated as errors Mark ret as __maybe_unused to clear the warning. Signed-off-by: John Garry <john.g.garry@xxxxxxxxxx> --- fs/xfs/xfs_trans.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/xfs/xfs_trans.c b/fs/xfs/xfs_trans.c index 7350640059cc..46674a9b1c97 100644 --- a/fs/xfs/xfs_trans.c +++ b/fs/xfs/xfs_trans.c @@ -598,7 +598,7 @@ xfs_trans_unreserve_and_mod_sb( int64_t rtxdelta = 0; int64_t idelta = 0; int64_t ifreedelta = 0; - int error; + int __maybe_unused error; /* calculate deltas */ if (tp->t_blk_res > 0) -- 2.31.1