diff mbox series

[-next] RDMA/uverbs: Use PTR_ERR_OR_ZERO in ib_uverbs_create_cq()

Message ID 1543455402-79511-1-git-send-email-yuehaibing@huawei.com (mailing list archive)
State Superseded
Headers show
Series [-next] RDMA/uverbs: Use PTR_ERR_OR_ZERO in ib_uverbs_create_cq() | expand

Commit Message

Yue Haibing Nov. 29, 2018, 1:36 a.m. UTC
Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/infiniband/core/uverbs_cmd.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Comments

Joey Pabalinas Nov. 29, 2018, 2:06 a.m. UTC | #1
On Thu, Nov 29, 2018 at 01:36:42AM +0000, YueHaibing wrote:
> Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR
> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

Reviewed-by: Joey Pabalinas <joeypabalinas@gmail.com>
Jason Gunthorpe Nov. 29, 2018, 11:40 p.m. UTC | #2
On Thu, Nov 29, 2018 at 01:36:42AM +0000, YueHaibing wrote:
> Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR
> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
>  drivers/infiniband/core/uverbs_cmd.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)

Sorry, but kbuild-robot beat you to it, I applied that version

Thanks,
Jason
diff mbox series

Patch

diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c
index 8ee9e94..0d31cee 100644
--- a/drivers/infiniband/core/uverbs_cmd.c
+++ b/drivers/infiniband/core/uverbs_cmd.c
@@ -1051,10 +1051,7 @@  static int ib_uverbs_create_cq(struct uverbs_attr_bundle *attrs,
 				sizeof(cmd.comp_channel),
 			ib_uverbs_create_cq_cb, NULL);
 
-	if (IS_ERR(obj))
-		return PTR_ERR(obj);
-
-	return 0;
+	return PTR_ERR_OR_ZERO(obj);
 }
 
 static int ib_uverbs_ex_create_cq_cb(struct uverbs_attr_bundle *attrs,