[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250812082554.48576-1-zhao.xichao@vivo.com>
Date: Tue, 12 Aug 2025 16:25:54 +0800
From: Xichao Zhao <zhao.xichao@...o.com>
To: clm@...com,
josef@...icpanda.com,
dsterba@...e.com
Cc: linux-btrfs@...r.kernel.org,
linux-kernel@...r.kernel.org,
Xichao Zhao <zhao.xichao@...o.com>
Subject: [PATCH] btrfs: use PTR_ERR_OR_ZERO() to simplify code
Use the standard error pointer macro to shorten the code and simplify.
Signed-off-by: Xichao Zhao <zhao.xichao@...o.com>
---
fs/btrfs/super.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index 68e35a3700ff..57dd58fd8b9c 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -2257,10 +2257,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 ==
--
2.34.1
Powered by blists - more mailing lists