]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
RDMA: Use ib_is_udata_in_empty() for places calling ib_is_udata_cleared()
authorJason Gunthorpe <jgg@nvidia.com>
Tue, 12 May 2026 00:09:30 +0000 (21:09 -0300)
committerLeon Romanovsky <leon@kernel.org>
Mon, 18 May 2026 08:58:42 +0000 (04:58 -0400)
commit55e6360d8f0e57de7d9158cb59ffc3ba43aa597f
tree23ea8bbee01462f494b2fddf8ae34d608e2cd4b8
parentcd31340419af6e0ae62b2c27985db209826a9577
RDMA: Use ib_is_udata_in_empty() for places calling ib_is_udata_cleared()

Convert the pattern:

  if (udata->inlen && !ib_is_udata_cleared(udata, 0, udata->inlen))

Using Coccinelle:

virtual patch
virtual context
virtual report

@@
expression udata;
@@
(
- udata->inlen && !ib_is_udata_cleared(udata, 0, udata->inlen)
+ !ib_is_udata_in_empty(udata)
|
- udata->inlen > 0 && !ib_is_udata_cleared(udata, 0, udata->inlen)
+ !ib_is_udata_in_empty(udata)
)

@@
expression udata;
@@
- udata && udata->inlen && !ib_is_udata_cleared(udata, 0, udata->inlen)
+ !ib_is_udata_in_empty(udata)

These cases are already checking for zeroed data that the kernel does
not understand.

Run another pass with AI to propagate the return code correctly and
remove redundant prints.

Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
drivers/infiniband/hw/efa/efa_verbs.c
drivers/infiniband/hw/mlx4/main.c
drivers/infiniband/hw/mlx4/qp.c
drivers/infiniband/hw/mlx5/main.c
drivers/infiniband/hw/mlx5/qp.c