]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
RDMA/uverbs: Convert to use ERR_CAST()
authorLi Haoran <li.haoran7@zte.com.cn>
Tue, 1 Apr 2025 13:09:23 +0000 (21:09 +0800)
committerJason Gunthorpe <jgg@nvidia.com>
Mon, 7 Apr 2025 18:12:07 +0000 (15:12 -0300)
As opposed to open-code, using the ERR_CAST macro clearly indicates that
this is a pointer to an error value and a type conversion was performed.

Link: https://patch.msgid.link/r/202504012109233981_YPVbd4wQzmAzP3tA5IG@zte.com.cn
Signed-off-by: Li Haoran <li.haoran7@zte.com.cn>
Signed-off-by: Shao Mingyin <shao.mingyin@zte.com.cn>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/core/uverbs_cmd.c

index 3c3bb670c805c9498f88b36bf30c6fb50b2a129e..bc9fe3ceca4dbe95a6abdeccdd11a5fbe00c9ca0 100644 (file)
@@ -193,7 +193,7 @@ _ib_uverbs_lookup_comp_file(s32 fd, struct uverbs_attr_bundle *attrs)
                                               fd, attrs);
 
        if (IS_ERR(uobj))
-               return (void *)uobj;
+               return ERR_CAST(uobj);
 
        uverbs_uobject_get(uobj);
        uobj_put_read(uobj);