diff mbox series

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

Message ID 20240425120846.707829-3-john.g.garry@oracle.com (mailing list archive)
State New
Headers show
Series xfs: Clear a couple of W=1 warnings | expand

Commit Message

John Garry April 25, 2024, 12:08 p.m. UTC
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@oracle.com>
---
 fs/xfs/xfs_trans.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Christoph Hellwig April 25, 2024, 12:18 p.m. UTC | #1
> +	int __maybe_unused	error;

error is gone in for-next.
John Garry April 25, 2024, 1:35 p.m. UTC | #2
On 25/04/2024 13:18, Christoph Hellwig wrote:
>> +	int __maybe_unused	error;
> 
> error is gone in for-next.
> 

ok, as long as this warning is acceptable for 6.9 - I assume what you 
reference is for 6.10
diff mbox series

Patch

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)