mirror of https://github.com/torvalds/linux.git
btrfs: use PTR_ERR_OR_ZERO() to simplify code inbtrfs_control_ioctl()
Use the standard error pointer macro to simplify the code. Reviewed-by: Daniel Vacek <neelx@suse.com> Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
d728f2e5f8
commit
28a38e20ac
|
|
@ -2274,10 +2274,7 @@ static long btrfs_control_ioctl(struct file *file, unsigned int cmd,
|
||||||
device = btrfs_scan_one_device(vol->name, false);
|
device = btrfs_scan_one_device(vol->name, false);
|
||||||
if (IS_ERR_OR_NULL(device)) {
|
if (IS_ERR_OR_NULL(device)) {
|
||||||
mutex_unlock(&uuid_mutex);
|
mutex_unlock(&uuid_mutex);
|
||||||
if (IS_ERR(device))
|
ret = PTR_ERR_OR_ZERO(device);
|
||||||
ret = PTR_ERR(device);
|
|
||||||
else
|
|
||||||
ret = 0;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
ret = !(device->fs_devices->num_devices ==
|
ret = !(device->fs_devices->num_devices ==
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue