diff mbox series

[2/2] btrfs-progs: remove the unused variable in check_chunks_and_extents_lowmem()

Message ID 20200826004734.89905-3-wqu@suse.com
State New, archived
Headers show
Series btrfs-progs: small compile warning fixes | expand

Commit Message

Qu Wenruo Aug. 26, 2020, 12:47 a.m. UTC
The variable @root is only set but not utilized, while we only utilize
@root1.

Replace @root1 with @root, then remove the @root1.

Signed-off-by: Qu Wenruo <wqu@suse.com>
---
 check/mode-lowmem.c | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

Comments

Josef Bacik Aug. 26, 2020, 2:29 p.m. UTC | #1
On 8/25/20 8:47 PM, Qu Wenruo wrote:
> The variable @root is only set but not utilized, while we only utilize
> @root1.
> 
> Replace @root1 with @root, then remove the @root1.
> 
> Signed-off-by: Qu Wenruo <wqu@suse.com>

Reviewed-by: Josef Bacik <josef@toxicpanda.com>

Thanks,

Josef
David Sterba Aug. 28, 2020, 4:06 p.m. UTC | #2
On Wed, Aug 26, 2020 at 08:47:34AM +0800, Qu Wenruo wrote:
> The variable @root is only set but not utilized, while we only utilize
> @root1.
> 
> Replace @root1 with @root, then remove the @root1.
> 
> Signed-off-by: Qu Wenruo <wqu@suse.com>

Added to devel, thanks.
diff mbox series

Patch

diff --git a/check/mode-lowmem.c b/check/mode-lowmem.c
index 3ce119fa0f61..837bacf920ac 100644
--- a/check/mode-lowmem.c
+++ b/check/mode-lowmem.c
@@ -5399,20 +5399,17 @@  int check_chunks_and_extents_lowmem(void)
 	struct btrfs_path path;
 	struct btrfs_key old_key;
 	struct btrfs_key key;
-	struct btrfs_root *root1;
 	struct btrfs_root *root;
 	struct btrfs_root *cur_root;
 	int err = 0;
 	int ret;
 
-	root = gfs_info->fs_root;
-
-	root1 = gfs_info->chunk_root;
-	ret = check_btrfs_root(root1, 1);
+	root = gfs_info->chunk_root;
+	ret = check_btrfs_root(root, 1);
 	err |= ret;
 
-	root1 = gfs_info->tree_root;
-	ret = check_btrfs_root(root1, 1);
+	root = gfs_info->tree_root;
+	ret = check_btrfs_root(root, 1);
 	err |= ret;
 
 	btrfs_init_path(&path);
@@ -5420,7 +5417,7 @@  int check_chunks_and_extents_lowmem(void)
 	key.offset = 0;
 	key.type = BTRFS_ROOT_ITEM_KEY;
 
-	ret = btrfs_search_slot(NULL, root1, &key, &path, 0, 0);
+	ret = btrfs_search_slot(NULL, root, &key, &path, 0, 0);
 	if (ret) {
 		error("cannot find extent tree in tree_root");
 		goto out;
@@ -5455,7 +5452,7 @@  int check_chunks_and_extents_lowmem(void)
 		if (ret)
 			goto out;
 next:
-		ret = btrfs_next_item(root1, &path);
+		ret = btrfs_next_item(root, &path);
 		if (ret)
 			goto out;
 	}