]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
btrfs: remove unnecessary tmp variable in btrfs_assign_next_active_device()
authorAnand Jain <anand.jain@oracle.com>
Fri, 4 Sep 2020 17:34:34 +0000 (01:34 +0800)
committerDavid Sterba <dsterba@suse.com>
Wed, 7 Oct 2020 10:12:22 +0000 (12:12 +0200)
We can check the argument value directly, no need for the temporary
variable.

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>
fs/btrfs/volumes.c

index beacc779dbc2c65daa9f980be1959a41378bb69d..78b67cc6cec1318e8aef7e3ae558582b6a780ab0 100644 (file)
@@ -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 &&