diff options
author | Jason Gunthorpe <jgg@mellanox.com> | 2018-11-25 20:58:45 +0200 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2018-12-03 12:01:58 -0500 |
commit | 974d6b4b2bc33c53334e086a40715b384f48f2e2 (patch) | |
tree | 86a6308f6ce39cc4127f0e4f03dd8348e4b7effd /drivers/infiniband/core/uverbs_uapi.c | |
parent | ece9ca97ccdc845c0c48e204e5a6d9149b7a24b3 (diff) | |
download | linux-974d6b4b2bc33c53334e086a40715b384f48f2e2.tar.bz2 |
RDMA/uverbs: Use only attrs for the write() handler signature
All of the old arguments can be derived from the uverbs_attr_bundle
structure, so get rid of the redundant arguments. Most of the prior work
has been removing users of the arguments to allow this to be a simple
patch.
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/core/uverbs_uapi.c')
-rw-r--r-- | drivers/infiniband/core/uverbs_uapi.c | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/drivers/infiniband/core/uverbs_uapi.c b/drivers/infiniband/core/uverbs_uapi.c index b3d5f36b0462..19ae4b19b2ef 100644 --- a/drivers/infiniband/core/uverbs_uapi.c +++ b/drivers/infiniband/core/uverbs_uapi.c @@ -8,14 +8,7 @@ #include "rdma_core.h" #include "uverbs.h" -static int ib_uverbs_notsupp(struct uverbs_attr_bundle *attrs, - const char __user *buf, int in_len, int out_len) -{ - return -EOPNOTSUPP; -} - -static int ib_uverbs_ex_notsupp(struct uverbs_attr_bundle *attrs, - struct ib_udata *ucore) +static int ib_uverbs_notsupp(struct uverbs_attr_bundle *attrs) { return -EOPNOTSUPP; } @@ -79,22 +72,17 @@ static int uapi_create_write(struct uverbs_api *uapi, if (IS_ERR(method_elm)) return PTR_ERR(method_elm); - if (WARN_ON(exists && (def->write.is_ex != method_elm->is_ex || - method_elm->handler_ex || method_elm->handler))) + if (WARN_ON(exists && (def->write.is_ex != method_elm->is_ex))) return -EINVAL; method_elm->is_ex = def->write.is_ex; - if (def->write.is_ex) { - method_elm->handler_ex = def->func_write_ex; - + method_elm->handler = def->func_write; + if (def->write.is_ex) method_elm->disabled = !(ibdev->uverbs_ex_cmd_mask & BIT_ULL(def->write.command_num)); - } else { - method_elm->handler = def->func_write; - + else method_elm->disabled = !(ibdev->uverbs_cmd_mask & BIT_ULL(def->write.command_num)); - } if (!def->write.is_ex && def->func_write) { method_elm->has_udata = def->write.has_udata; @@ -449,7 +437,6 @@ static int uapi_finalize(struct uverbs_api *uapi) } uapi->notsupp_method.handler = ib_uverbs_notsupp; - uapi->notsupp_method.handler_ex = ib_uverbs_ex_notsupp; uapi->num_write = max_write + 1; uapi->num_write_ex = max_write_ex + 1; data = kmalloc_array(uapi->num_write + uapi->num_write_ex, |