From: Anand Jain Date: Fri, 4 Sep 2020 17:34:34 +0000 (+0800) Subject: btrfs: remove unnecessary tmp variable in btrfs_assign_next_active_device() X-Git-Tag: v5.10-rc1~178^2~60 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e493e8f9bcb5f6cf00f94d30eddc43c5be731ff4;p=thirdparty%2Fkernel%2Flinux.git btrfs: remove unnecessary tmp variable in btrfs_assign_next_active_device() We can check the argument value directly, no need for the temporary variable. Reviewed-by: Nikolay Borisov Signed-off-by: Anand Jain Reviewed-by: David Sterba Signed-off-by: David Sterba --- diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index beacc779dbc2c..78b67cc6cec13 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -1962,16 +1962,13 @@ static struct btrfs_device * btrfs_find_next_active_device( * this_dev) which is active. */ void __cold btrfs_assign_next_active_device(struct btrfs_device *device, - struct btrfs_device *this_dev) + struct btrfs_device *next_device) { struct btrfs_fs_info *fs_info = device->fs_info; - struct btrfs_device *next_device; - if (this_dev) - next_device = this_dev; - else + if (!next_device) next_device = btrfs_find_next_active_device(fs_info->fs_devices, - device); + device); ASSERT(next_device); if (fs_info->sb->s_bdev &&