summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorJason Gunthorpe <jgg@mellanox.com>2018-07-06 20:42:03 +0300
committerJason Gunthorpe <jgg@mellanox.com>2018-07-09 22:19:01 +0300
commit97202bbe22f8f0c225ba63a50acaf56d6796c990 (patch)
treeb1502a4b27a6340cfc7b0c57c04e188cfdded372 /drivers
parent60e6627f12a78203a093ca05b7bca15627747d81 (diff)
downloadlinux-97202bbe22f8f0c225ba63a50acaf56d6796c990.tar.xz
IB/uverbs: Do not use uverbs_cmd_mask in the ioctl path
Instead we are now checking the function pointers directly. Get rid of both cases in ioctl and drop the nonsense idea that destroy can fail. Signed-off-by: Jason Gunthorpe <jgg@mellanox.com> Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/infiniband/core/uverbs_std_types_cq.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/infiniband/core/uverbs_std_types_cq.c b/drivers/infiniband/core/uverbs_std_types_cq.c
index ce9c9c66bae4..5a6154345fa0 100644
--- a/drivers/infiniband/core/uverbs_std_types_cq.c
+++ b/drivers/infiniband/core/uverbs_std_types_cq.c
@@ -70,7 +70,7 @@ static int UVERBS_HANDLER(UVERBS_METHOD_CQ_CREATE)(struct ib_device *ib_dev,
struct ib_uverbs_completion_event_file *ev_file = NULL;
struct ib_uobject *ev_file_uobj;
- if (!(ib_dev->uverbs_cmd_mask & 1ULL << IB_USER_VERBS_CMD_CREATE_CQ))
+ if (!ib_dev->create_cq || !ib_dev->destroy_cq)
return -EOPNOTSUPP;
ret = uverbs_copy_from(&attr.comp_vector, attrs,
@@ -185,9 +185,6 @@ static int UVERBS_HANDLER(UVERBS_METHOD_CQ_DESTROY)(struct ib_device *ib_dev,
obj = container_of(uobj, struct ib_ucq_object, uobject);
- if (!(ib_dev->uverbs_cmd_mask & 1ULL << IB_USER_VERBS_CMD_DESTROY_CQ))
- return -EOPNOTSUPP;
-
ret = rdma_explicit_destroy(uobj);
if (ret)
return ret;