[PATCH 2/2] xfs: Clear W=1 warning in xfs_trans_unreserve_and_mod_sb():

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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





[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux