RE: [Intel-wired-lan] [PATCH 54/61] aoe: Prefer IS_ERR_OR_NULL over manual NULL check

From: Loktionov, Aleksandr

Date: Wed Mar 11 2026 - 05:46:13 EST




> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@xxxxxxxxxx> On Behalf
> Of Philipp Hahn
> Sent: Tuesday, March 10, 2026 12:49 PM
> To: amd-gfx@xxxxxxxxxxxxxxxxxxxxx; apparmor@xxxxxxxxxxxxxxxx;
> bpf@xxxxxxxxxxxxxxx; ceph-devel@xxxxxxxxxxxxxxx; cocci@xxxxxxxx; dm-
> devel@xxxxxxxxxxxxxxx; dri-devel@xxxxxxxxxxxxxxxxxxxxx;
> gfs2@xxxxxxxxxxxxxxx; intel-gfx@xxxxxxxxxxxxxxxxxxxxx; intel-wired-
> lan@xxxxxxxxxxxxxxxx; iommu@xxxxxxxxxxxxxxx; kvm@xxxxxxxxxxxxxxx;
> linux-arm-kernel@xxxxxxxxxxxxxxxxxxx; linux-block@xxxxxxxxxxxxxxx;
> linux-bluetooth@xxxxxxxxxxxxxxx; linux-btrfs@xxxxxxxxxxxxxxx; linux-
> cifs@xxxxxxxxxxxxxxx; linux-clk@xxxxxxxxxxxxxxx; linux-
> erofs@xxxxxxxxxxxxxxxx; linux-ext4@xxxxxxxxxxxxxxx; linux-
> fsdevel@xxxxxxxxxxxxxxx; linux-gpio@xxxxxxxxxxxxxxx; linux-
> hyperv@xxxxxxxxxxxxxxx; linux-input@xxxxxxxxxxxxxxx; linux-
> kernel@xxxxxxxxxxxxxxx; linux-leds@xxxxxxxxxxxxxxx; linux-
> media@xxxxxxxxxxxxxxx; linux-mips@xxxxxxxxxxxxxxx; linux-mm@xxxxxxxxx;
> linux-modules@xxxxxxxxxxxxxxx; linux-mtd@xxxxxxxxxxxxxxxxxxx; linux-
> nfs@xxxxxxxxxxxxxxx; linux-omap@xxxxxxxxxxxxxxx; linux-
> phy@xxxxxxxxxxxxxxxxxxx; linux-pm@xxxxxxxxxxxxxxx; linux-
> rockchip@xxxxxxxxxxxxxxxxxxx; linux-s390@xxxxxxxxxxxxxxx; linux-
> scsi@xxxxxxxxxxxxxxx; linux-sctp@xxxxxxxxxxxxxxx; linux-security-
> module@xxxxxxxxxxxxxxx; linux-sh@xxxxxxxxxxxxxxx; linux-
> sound@xxxxxxxxxxxxxxx; linux-stm32@xxxxxxxxxxxxxxxxxxxxxxxxxxxx;
> linux-trace-kernel@xxxxxxxxxxxxxxx; linux-usb@xxxxxxxxxxxxxxx; linux-
> wireless@xxxxxxxxxxxxxxx; netdev@xxxxxxxxxxxxxxx;
> ntfs3@xxxxxxxxxxxxxxx; samba-technical@xxxxxxxxxxxxxxx; sched-
> ext@xxxxxxxxxxxxxxx; target-devel@xxxxxxxxxxxxxxx; tipc-
> discussion@xxxxxxxxxxxxxxxxxxxxx; v9fs@xxxxxxxxxxxxxxx; Philipp Hahn
> <phahn-oss@xxxxxx>
> Cc: Justin Sanders <justin@xxxxxxxxxx>; Jens Axboe <axboe@xxxxxxxxx>
> Subject: [Intel-wired-lan] [PATCH 54/61] aoe: Prefer IS_ERR_OR_NULL
> over manual NULL check
>
> Prefer using IS_ERR_OR_NULL() over using IS_ERR() and a manual NULL
> check.
>
> Change generated with coccinelle.
>
> To: Justin Sanders <justin@xxxxxxxxxx>
> To: Jens Axboe <axboe@xxxxxxxxx>
> Cc: linux-block@xxxxxxxxxxxxxxx
> Cc: linux-kernel@xxxxxxxxxxxxxxx
> Signed-off-by: Philipp Hahn <phahn-oss@xxxxxx>
> ---
> drivers/block/aoe/aoecmd.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/block/aoe/aoecmd.c b/drivers/block/aoe/aoecmd.c
> index
> a4744a30a8af4ff05113f3234021eec728265b4f..b31e539a66433a0a5d6e81117a32
> d12735ffc1bc 100644
> --- a/drivers/block/aoe/aoecmd.c
> +++ b/drivers/block/aoe/aoecmd.c
> @@ -1268,7 +1268,7 @@ aoe_ktstart(struct ktstate *k)
>
> init_completion(&k->rendez);
> task = kthread_run(kthread, k, "%s", k->name);
> - if (task == NULL || IS_ERR(task))
> + if (IS_ERR_OR_NULL(task))
> return -ENOMEM;
> k->task = task;
> wait_for_completion(&k->rendez); /* allow kthread to start */
>
> --
> 2.43.0

Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@xxxxxxxxx>