Re: [PATCH -next] xfs: Fix -Wunused-variable warning

From: YueHaibing
Date: Fri Jun 11 2021 - 08:10:47 EST


PLS ignore this.

On 2021/6/11 19:59, YueHaibing wrote:
> If DEBUG is n, gcc warns:
>
> fs/xfs/libxfs/xfs_ialloc.c:2032:20: warning: unused variable ‘agi’ [-Wunused-variable]
>
> Move it info #ifdef block to fix this.
>
> Signed-off-by: YueHaibing <yuehaibing@xxxxxxxxxx>
> ---
> fs/xfs/libxfs/xfs_ialloc.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/fs/xfs/libxfs/xfs_ialloc.c b/fs/xfs/libxfs/xfs_ialloc.c
> index 2ed6de6faf8a..a9973edd3c0a 100644
> --- a/fs/xfs/libxfs/xfs_ialloc.c
> +++ b/fs/xfs/libxfs/xfs_ialloc.c
> @@ -2029,7 +2029,9 @@ xfs_difree_finobt(
> xfs_agino_t agino,
> struct xfs_inobt_rec_incore *ibtrec) /* inobt record */
> {
> +#ifdef DEBUG
> struct xfs_agi *agi = agbp->b_addr;
> +#endif
> struct xfs_btree_cur *cur;
> struct xfs_inobt_rec_incore rec;
> int offset = agino - ibtrec->ir_startino;
>