diff mbox series

[-next] btrfs: remove set but not used variable 'tree'

Message ID 1541643283-109411-1-git-send-email-yuehaibing@huawei.com (mailing list archive)
State New, archived
Headers show
Series [-next] btrfs: remove set but not used variable 'tree' | expand

Commit Message

Yue Haibing Nov. 8, 2018, 2:14 a.m. UTC
Fixes gcc '-Wunused-but-set-variable' warning:

fs/btrfs/extent_io.c: In function 'end_extent_writepage':
fs/btrfs/extent_io.c:2406:25: warning:
 variable 'tree' set but not used [-Wunused-but-set-variable]

It not used any more after
commit 2922040236f9 ("btrfs: Remove extent_io_ops::writepage_end_io_hook")

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 fs/btrfs/extent_io.c | 3 ---
 1 file changed, 3 deletions(-)

Comments

Nikolay Borisov Nov. 8, 2018, 6:53 a.m. UTC | #1
On 8.11.18 г. 4:14 ч., YueHaibing wrote:
> Fixes gcc '-Wunused-but-set-variable' warning:
> 
> fs/btrfs/extent_io.c: In function 'end_extent_writepage':
> fs/btrfs/extent_io.c:2406:25: warning:
>  variable 'tree' set but not used [-Wunused-but-set-variable]
> 
> It not used any more after
> commit 2922040236f9 ("btrfs: Remove extent_io_ops::writepage_end_io_hook")
> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

Reviewed-by: Nikolay Borisov <nborisov@suse.com>

> ---
>  fs/btrfs/extent_io.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
> index 0f8f9c0..17a15cc 100644
> --- a/fs/btrfs/extent_io.c
> +++ b/fs/btrfs/extent_io.c
> @@ -2403,11 +2403,8 @@ static int bio_readpage_error(struct bio *failed_bio, u64 phy_offset,
>  void end_extent_writepage(struct page *page, int err, u64 start, u64 end)
>  {
>  	int uptodate = (err == 0);
> -	struct extent_io_tree *tree;
>  	int ret = 0;
>  
> -	tree = &BTRFS_I(page->mapping->host)->io_tree;
> -
>  	btrfs_writepage_endio_finish_ordered(page, start, end, NULL, uptodate);
>  
>  	if (!uptodate) {
> 
> 
> 
>
David Sterba Nov. 8, 2018, 12:11 p.m. UTC | #2
On Thu, Nov 08, 2018 at 02:14:43AM +0000, YueHaibing wrote:
> Fixes gcc '-Wunused-but-set-variable' warning:
> 
> fs/btrfs/extent_io.c: In function 'end_extent_writepage':
> fs/btrfs/extent_io.c:2406:25: warning:
>  variable 'tree' set but not used [-Wunused-but-set-variable]
> 
> It not used any more after
> commit 2922040236f9 ("btrfs: Remove extent_io_ops::writepage_end_io_hook")
> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

Thanks, the patches are still out of mainline so the commit id is not
stable and I can fold in the fixup. Same for the other one.
diff mbox series

Patch

diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index 0f8f9c0..17a15cc 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -2403,11 +2403,8 @@  static int bio_readpage_error(struct bio *failed_bio, u64 phy_offset,
 void end_extent_writepage(struct page *page, int err, u64 start, u64 end)
 {
 	int uptodate = (err == 0);
-	struct extent_io_tree *tree;
 	int ret = 0;
 
-	tree = &BTRFS_I(page->mapping->host)->io_tree;
-
 	btrfs_writepage_endio_finish_ordered(page, start, end, NULL, uptodate);
 
 	if (!uptodate) {