Re: [PATCH v2 rdma-next] RDMA: Use ERR_CAST to return an error-valued pointer

From: Leon Romanovsky
Date: Tue Sep 10 2024 - 08:23:58 EST


On Fri, Sep 06, 2024 at 02:21:36PM +0800, Yu Jiaoliang wrote:
> Instead of directly casting and returning an error-valued pointer,
> use ERR_CAST to make the error handling more explicit and improve
> code clarity.
>
> Signed-off-by: Yu Jiaoliang <yujiaoliang@xxxxxxxx>
> ---
> v2:
> - Additional modifications in file /drivers/infiniband/hw/irdma/verbs.c
> v1: https://lore.kernel.org/all/20240905110615.GU4026@unreal/
> ---
> drivers/infiniband/core/mad_rmpp.c | 2 +-
> drivers/infiniband/core/uverbs_cmd.c | 2 +-
> drivers/infiniband/core/verbs.c | 2 +-
> drivers/infiniband/hw/irdma/verbs.c | 4 ++--
> 4 files changed, 5 insertions(+), 5 deletions(-)

It is still incomplete.
Something like that will give you a better result:
➜ kernel git:(wip/leon-for-next) git grep "return (" drivers/infiniband/ | grep "\*"

Thanks