[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAPjX3FdqXPnb=_JDsAtid2WszaqaODM1rxF5XcGGy7WmfJLquw@mail.gmail.com>
Date: Tue, 12 Aug 2025 10:32:47 +0200
From: Daniel Vacek <neelx@...e.com>
To: Xichao Zhao <zhao.xichao@...o.com>
Cc: clm@...com, josef@...icpanda.com, dsterba@...e.com,
linux-btrfs@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] btrfs: use PTR_ERR_OR_ZERO() to simplify code
On Tue, 12 Aug 2025 at 10:27, Xichao Zhao <zhao.xichao@...o.com> wrote:
>
> 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);
LGTM.
Reviewed-by: Daniel Vacek <neelx@...e.com>
> break;
> }
> ret = !(device->fs_devices->num_devices ==
> --
> 2.34.1
>
>
Powered by blists - more mailing lists