Skip to content

Commit 1888709

Browse files
asjkdave
authored andcommitted
btrfs: remove tmp variable for list traversal in btrfs_init_dev_replace_tgtdev
In the function btrfs_init_dev_replace_tgtdev(), the local variable devices is used only once, we can remove it. Reviewed-by: Nikolay Borisov <nborisov@suse.com> Signed-off-by: Anand Jain <anand.jain@oracle.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
1 parent e17125b commit 1888709

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

‎fs/btrfs/dev-replace.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,6 @@ static int btrfs_init_dev_replace_tgtdev(struct btrfs_fs_info *fs_info,
224224
{
225225
struct btrfs_device *device;
226226
struct block_device *bdev;
227-
struct list_head *devices;
228227
struct rcu_string *name;
229228
u64 devid = BTRFS_DEV_REPLACE_DEVID;
230229
int ret = 0;
@@ -244,8 +243,7 @@ static int btrfs_init_dev_replace_tgtdev(struct btrfs_fs_info *fs_info,
244243

245244
sync_blockdev(bdev);
246245

247-
devices = &fs_info->fs_devices->devices;
248-
list_for_each_entry(device, devices, dev_list) {
246+
list_for_each_entry(device, &fs_info->fs_devices->devices, dev_list) {
249247
if (device->bdev == bdev) {
250248
btrfs_err(fs_info,
251249
"target device is in the filesystem!");

0 commit comments

Comments
 (0)