linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] btrfs: remove set but not used variable 'root_owner'
@ 2020-02-19 11:21 yu kuai
  2020-02-19 11:35 ` Nikolay Borisov
  0 siblings, 1 reply; 2+ messages in thread
From: yu kuai @ 2020-02-19 11:21 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:2698:6: warning: variable ‘root_owner’
set but not used [-Wunused-but-set-variable]
fs/btrfs/tree-log.c: In function ‘walk_up_log_tree’:
fs/btrfs/tree-log.c:2793:6: warning: variable ‘root_owner’
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 | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
index 5e6b18924e00..156beda01b18 100644
--- a/fs/btrfs/tree-log.c
+++ b/fs/btrfs/tree-log.c
@@ -2695,7 +2695,6 @@ static noinline int walk_down_log_tree(struct btrfs_trans_handle *trans,
 				   struct walk_control *wc)
 {
 	struct btrfs_fs_info *fs_info = root->fs_info;
-	u64 root_owner;
 	u64 bytenr;
 	u64 ptr_gen;
 	struct extent_buffer *next;
@@ -2721,7 +2720,6 @@ static noinline int walk_down_log_tree(struct btrfs_trans_handle *trans,
 		blocksize = fs_info->nodesize;
 
 		parent = path->nodes[*level];
-		root_owner = btrfs_header_owner(parent);
 
 		next = btrfs_find_create_tree_block(fs_info, bytenr);
 		if (IS_ERR(next))
@@ -2790,7 +2788,6 @@ static noinline int walk_up_log_tree(struct btrfs_trans_handle *trans,
 				 struct walk_control *wc)
 {
 	struct btrfs_fs_info *fs_info = root->fs_info;
-	u64 root_owner;
 	int i;
 	int slot;
 	int ret;
@@ -2809,7 +2806,6 @@ static noinline int walk_up_log_tree(struct btrfs_trans_handle *trans,
 			else
 				parent = path->nodes[*level + 1];
 
-			root_owner = btrfs_header_owner(parent);
 			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] 2+ messages in thread

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



On 19.02.20 г. 13:21 ч., 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:2698:6: warning: variable ‘root_owner’
> set but not used [-Wunused-but-set-variable]
> fs/btrfs/tree-log.c: In function ‘walk_up_log_tree’:
> fs/btrfs/tree-log.c:2793:6: warning: variable ‘root_owner’
> 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>

Yep, can be squashed into :
e084c5ab48f9 ("btrfs: Call btrfs_pin_reserved_extent only during active
transaction")

in any case:

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

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

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

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

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).