Skip to content

Commit 08aed6e

Browse files
Xichao Zhaokdave
authored andcommitted
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 <[email protected]> Signed-off-by: Xichao Zhao <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 3a57190 commit 08aed6e

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

fs/btrfs/super.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2257,10 +2257,7 @@ static long btrfs_control_ioctl(struct file *file, unsigned int cmd,
22572257
device = btrfs_scan_one_device(vol->name, false);
22582258
if (IS_ERR_OR_NULL(device)) {
22592259
mutex_unlock(&uuid_mutex);
2260-
if (IS_ERR(device))
2261-
ret = PTR_ERR(device);
2262-
else
2263-
ret = 0;
2260+
ret = PTR_ERR_OR_ZERO(device);
22642261
break;
22652262
}
22662263
ret = !(device->fs_devices->num_devices ==

0 commit comments

Comments
 (0)