]> www.infradead.org Git - users/hch/misc.git/commitdiff
btrfs: use PTR_ERR_OR_ZERO() to simplify code inbtrfs_control_ioctl()
authorXichao Zhao <zhao.xichao@vivo.com>
Tue, 12 Aug 2025 08:25:54 +0000 (16:25 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 22 Sep 2025 08:54:31 +0000 (10:54 +0200)
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>
fs/btrfs/super.c

index b06b8f325537811cbec16ce23b3212f1a0c4a7c1..ee2418bb2efd0b4c8a4227d5c0c3a923615acbde 100644 (file)
@@ -2274,10 +2274,7 @@ static long btrfs_control_ioctl(struct file *file, unsigned int cmd,
                device = btrfs_scan_one_device(vol->name, false);
                if (IS_ERR_OR_NULL(device)) {
                        mutex_unlock(&uuid_mutex);
-                       if (IS_ERR(device))
-                               ret = PTR_ERR(device);
-                       else
-                               ret = 0;
+                       ret = PTR_ERR_OR_ZERO(device);
                        break;
                }
                ret = !(device->fs_devices->num_devices ==