diff options
author | Jason Gunthorpe <jgg@mellanox.com> | 2018-07-04 08:50:26 +0300 |
---|---|---|
committer | Jason Gunthorpe <jgg@mellanox.com> | 2018-07-04 13:47:01 -0600 |
commit | 595c7736d48037d67e7926f5d3ebf484b95b1d13 (patch) | |
tree | 24961a06b5f83db6b638415fa575e5cd5d4115be /drivers/infiniband/core/uverbs_std_types_counters.c | |
parent | RDMA/uverbs: Simplify UVERBS_ATTR family of macros (diff) | |
download | linux-dev-595c7736d48037d67e7926f5d3ebf484b95b1d13.tar.xz linux-dev-595c7736d48037d67e7926f5d3ebf484b95b1d13.zip |
RDMA/uverbs: Simplify method definition macros
Instead of the large set of indirecting macros, define the few needed
macros to directly instantiate the struct uverbs_method_def and associated
attributes list.
This is small amount of code duplication but the readability is far
better.
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Diffstat (limited to 'drivers/infiniband/core/uverbs_std_types_counters.c')
-rw-r--r-- | drivers/infiniband/core/uverbs_std_types_counters.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/infiniband/core/uverbs_std_types_counters.c b/drivers/infiniband/core/uverbs_std_types_counters.c index 6d0b1ce9fc1f..61fd65bc9496 100644 --- a/drivers/infiniband/core/uverbs_std_types_counters.c +++ b/drivers/infiniband/core/uverbs_std_types_counters.c @@ -124,21 +124,20 @@ err_read: return ret; } -static DECLARE_UVERBS_NAMED_METHOD(UVERBS_METHOD_COUNTERS_CREATE, +DECLARE_UVERBS_NAMED_METHOD(UVERBS_METHOD_COUNTERS_CREATE, &UVERBS_ATTR_IDR(UVERBS_ATTR_CREATE_COUNTERS_HANDLE, UVERBS_OBJECT_COUNTERS, UVERBS_ACCESS_NEW, UA_FLAGS(UVERBS_ATTR_SPEC_F_MANDATORY))); -static DECLARE_UVERBS_NAMED_METHOD_WITH_HANDLER(UVERBS_METHOD_COUNTERS_DESTROY, - uverbs_destroy_def_handler, +DECLARE_UVERBS_NAMED_METHOD_DESTROY(UVERBS_METHOD_COUNTERS_DESTROY, &UVERBS_ATTR_IDR(UVERBS_ATTR_DESTROY_COUNTERS_HANDLE, UVERBS_OBJECT_COUNTERS, UVERBS_ACCESS_DESTROY, UA_FLAGS(UVERBS_ATTR_SPEC_F_MANDATORY))); #define MAX_COUNTERS_BUFF_SIZE USHRT_MAX -static DECLARE_UVERBS_NAMED_METHOD(UVERBS_METHOD_COUNTERS_READ, +DECLARE_UVERBS_NAMED_METHOD(UVERBS_METHOD_COUNTERS_READ, &UVERBS_ATTR_IDR(UVERBS_ATTR_READ_COUNTERS_HANDLE, UVERBS_OBJECT_COUNTERS, UVERBS_ACCESS_READ, |