Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR Signed-off-by: YueHaibing <yuehaibing@xxxxxxxxxx> --- drivers/infiniband/core/uverbs_cmd.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) 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,