RDMA/uverbs: fix ptr_ret.cocci warnings

drivers/infiniband/core/uverbs_cmd.c:1095:1-3: WARNING: PTR_ERR_OR_ZERO can be used

 Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR

Generated by: scripts/coccinelle/api/ptr_ret.cocci

Fixes: 7106a97697 ("RDMA/uverbs: Make write() handlers return 0 on success")
Signed-off-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
This commit is contained in:
kbuild test robot 2018-11-28 07:21:30 +08:00 committed by Jason Gunthorpe
parent 901018f29e
commit 90849f4d05
1 changed files with 1 additions and 5 deletions
drivers/infiniband/core

View File

@ -1050,11 +1050,7 @@ static int ib_uverbs_create_cq(struct uverbs_attr_bundle *attrs,
offsetof(typeof(cmd_ex), comp_channel) +
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,