btrfs: return a literal instead of a variable in btrfs_init_dev_replace()

This is just a small clean up, it doesn't change how the code works.
Originally this code had a goto so we needed to set "ret = 0;" but now
it returns directly and so we can simplify it a bit by doing a
"return 0;" and removing the assignment.

Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
Dan Carpenter
2025-03-05 18:01:57 +03:00
committed by David Sterba
parent 477a7a9c1f
commit c01b7114b8

View File

@@ -103,7 +103,6 @@ no_valid_dev_replace_entry_found:
"found replace target device without a valid replace item");
return -EUCLEAN;
}
ret = 0;
dev_replace->replace_state =
BTRFS_IOCTL_DEV_REPLACE_STATE_NEVER_STARTED;
dev_replace->cont_reading_from_srcdev_mode =
@@ -120,7 +119,7 @@ no_valid_dev_replace_entry_found:
dev_replace->tgtdev = NULL;
dev_replace->is_valid = 0;
dev_replace->item_needs_writeback = 0;
return ret;
return 0;
}
slot = path->slots[0];
eb = path->nodes[0];