linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/3] btrfs: remove set but not used variable 'parent'
@ 2020-02-19 11:22 yu kuai
  2020-02-19 11:34 ` Nikolay Borisov
  0 siblings, 1 reply; 3+ messages in thread
From: yu kuai @ 2020-02-19 11:22 UTC (permalink / raw)
  To: clm, josef, dsterba
  Cc: linux-btrfs, linux-kernel, yukuai3, zhengbin13, yi.zhang

Fixes gcc '-Wunused-but-set-variable' warning:

fs/btrfs/tree-log.c: In function ‘walk_down_log_tree’:
fs/btrfs/tree-log.c:2702:24: warning: variable ‘parent’
set but not used [-Wunused-but-set-variable]
fs/btrfs/tree-log.c: In function ‘walk_up_log_tree’:
fs/btrfs/tree-log.c:2803:26: warning: variable ‘parent’
set but not used [-Wunused-but-set-variable]

They are never used, and so can be removed.

Signed-off-by: yu kuai <yukuai3@huawei.com>
---
 fs/btrfs/tree-log.c | 9 ---------
 1 file changed, 9 deletions(-)

diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
index 156beda01b18..19c107be9ef6 100644
--- a/fs/btrfs/tree-log.c
+++ b/fs/btrfs/tree-log.c
@@ -2699,7 +2699,6 @@ static noinline int walk_down_log_tree(struct btrfs_trans_handle *trans,
 	u64 ptr_gen;
 	struct extent_buffer *next;
 	struct extent_buffer *cur;
-	struct extent_buffer *parent;
 	u32 blocksize;
 	int ret = 0;
 
@@ -2719,8 +2718,6 @@ static noinline int walk_down_log_tree(struct btrfs_trans_handle *trans,
 		btrfs_node_key_to_cpu(cur, &first_key, path->slots[*level]);
 		blocksize = fs_info->nodesize;
 
-		parent = path->nodes[*level];
-
 		next = btrfs_find_create_tree_block(fs_info, bytenr);
 		if (IS_ERR(next))
 			return PTR_ERR(next);
@@ -2800,12 +2797,6 @@ static noinline int walk_up_log_tree(struct btrfs_trans_handle *trans,
 			WARN_ON(*level == 0);
 			return 0;
 		} else {
-			struct extent_buffer *parent;
-			if (path->nodes[*level] == root->node)
-				parent = path->nodes[*level];
-			else
-				parent = path->nodes[*level + 1];
-
 			ret = wc->process_func(root, path->nodes[*level], wc,
 				 btrfs_header_generation(path->nodes[*level]),
 				 *level);
-- 
2.17.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 2/3] btrfs: remove set but not used variable 'parent'
  2020-02-19 11:22 [PATCH 2/3] btrfs: remove set but not used variable 'parent' yu kuai
@ 2020-02-19 11:34 ` Nikolay Borisov
  2020-02-19 14:17   ` David Sterba
  0 siblings, 1 reply; 3+ messages in thread
From: Nikolay Borisov @ 2020-02-19 11:34 UTC (permalink / raw)
  To: yu kuai, clm, josef, dsterba
  Cc: linux-btrfs, linux-kernel, zhengbin13, yi.zhang



On 19.02.20 г. 13:22 ч., yu kuai wrote:
> Fixes gcc '-Wunused-but-set-variable' warning:
> 
> fs/btrfs/tree-log.c: In function ‘walk_down_log_tree’:
> fs/btrfs/tree-log.c:2702:24: warning: variable ‘parent’
> set but not used [-Wunused-but-set-variable]
> fs/btrfs/tree-log.c: In function ‘walk_up_log_tree’:
> fs/btrfs/tree-log.c:2803:26: warning: variable ‘parent’
> set but not used [-Wunused-but-set-variable]
> 
> They are never used, and so can be removed.
> 
> Signed-off-by: yu kuai <yukuai3@huawei.com>

Ah yes, those two are a result of my :

e084c5ab48f9 ("btrfs: Call btrfs_pin_reserved_extent only during active
transaction")  (in misc-next branch)

David perhaps you can squash the two var removals into the original patch?


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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 2/3] btrfs: remove set but not used variable 'parent'
  2020-02-19 11:34 ` Nikolay Borisov
@ 2020-02-19 14:17   ` David Sterba
  0 siblings, 0 replies; 3+ messages in thread
From: David Sterba @ 2020-02-19 14:17 UTC (permalink / raw)
  To: Nikolay Borisov
  Cc: yu kuai, clm, josef, dsterba, linux-btrfs, linux-kernel,
	zhengbin13, yi.zhang

On Wed, Feb 19, 2020 at 01:34:53PM +0200, Nikolay Borisov wrote:
> 
> 
> On 19.02.20 г. 13:22 ч., yu kuai wrote:
> > Fixes gcc '-Wunused-but-set-variable' warning:
> > 
> > fs/btrfs/tree-log.c: In function ‘walk_down_log_tree’:
> > fs/btrfs/tree-log.c:2702:24: warning: variable ‘parent’
> > set but not used [-Wunused-but-set-variable]
> > fs/btrfs/tree-log.c: In function ‘walk_up_log_tree’:
> > fs/btrfs/tree-log.c:2803:26: warning: variable ‘parent’
> > set but not used [-Wunused-but-set-variable]
> > 
> > They are never used, and so can be removed.
> > 
> > Signed-off-by: yu kuai <yukuai3@huawei.com>
> 
> Ah yes, those two are a result of my :
> 
> e084c5ab48f9 ("btrfs: Call btrfs_pin_reserved_extent only during active
> transaction")  (in misc-next branch)
> 
> David perhaps you can squash the two var removals into the original patch?

Yes I'll do that.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-02-19 14:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-19 11:22 [PATCH 2/3] btrfs: remove set but not used variable 'parent' yu kuai
2020-02-19 11:34 ` Nikolay Borisov
2020-02-19 14:17   ` David Sterba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).