xfs
[Top] [All Lists]

Re: [PATCH] xfs: hide unused variable

To: xfs@xxxxxxxxxxx
Subject: Re: [PATCH] xfs: hide unused variable
From: Eric Sandeen <sandeen@xxxxxxxxxxx>
Date: Mon, 13 Jun 2016 16:32:22 -0500
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <1460838665-1249242-1-git-send-email-arnd@xxxxxxxx>
References: <1460838665-1249242-1-git-send-email-arnd@xxxxxxxx>
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.1.1
On 4/16/16 3:30 PM, Arnd Bergmann wrote:
> The newly added xfs_finish_page_writeback() function causes
> a harmless gcc warning when debugging is disabled:
> 
> fs/xfs/xfs_aops.c: In function 'xfs_finish_page_writeback':
> fs/xfs/xfs_aops.c:97:16: error: unused variable 'blockmask' 
> [-Werror=unused-variable]
>   unsigned int  blockmask = (1 << inode->i_blkbits) - 1;
>                 ^~~~~~~~~
> 
> This adds an #ifdef around the variable declaration to hide
> it whenever the ASSERT macro is defined as a stub, following
> the same style as used elsewhere in xfs.

Thanks Arnd - 

This got fixed by hch's patch,

690a787 xfs: fix warning in xfs_finish_page_writeback for non-debug builds

-Eric

 
> Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>
> Fixes: 37992c18bba3 ("xfs: don't release bios on completion immediately")
> ---
>  fs/xfs/xfs_aops.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c
> index e5c3a457c191..737d028914a2 100644
> --- a/fs/xfs/xfs_aops.c
> +++ b/fs/xfs/xfs_aops.c
> @@ -94,7 +94,9 @@ xfs_finish_page_writeback(
>       struct bio_vec          *bvec,
>       int                     error)
>  {
> +#if defined(DEBUG) || defined(XFS_WARN)
>       unsigned int            blockmask = (1 << inode->i_blkbits) - 1;
> +#endif
>       unsigned int            end = bvec->bv_offset + bvec->bv_len - 1;
>       struct buffer_head      *head, *bh;
>       unsigned int            off = 0;
> 

<Prev in Thread] Current Thread [Next in Thread>
  • Re: [PATCH] xfs: hide unused variable, Eric Sandeen <=