diff options
author | Jason Gunthorpe <jgg@mellanox.com> | 2018-07-04 08:50:26 +0300 |
---|---|---|
committer | Jason Gunthorpe <jgg@mellanox.com> | 2018-07-04 22:47:01 +0300 |
commit | 595c7736d48037d67e7926f5d3ebf484b95b1d13 (patch) | |
tree | 24961a06b5f83db6b638415fa575e5cd5d4115be /include/rdma/uverbs_ioctl.h | |
parent | d108dac08085b6fe3947df9625c76fc9f66c1bbb (diff) | |
download | linux-595c7736d48037d67e7926f5d3ebf484b95b1d13.tar.xz |
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 'include/rdma/uverbs_ioctl.h')
-rw-r--r-- | include/rdma/uverbs_ioctl.h | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/include/rdma/uverbs_ioctl.h b/include/rdma/uverbs_ioctl.h index a7246e9cb148..12fa0eef0ab0 100644 --- a/include/rdma/uverbs_ioctl.h +++ b/include/rdma/uverbs_ioctl.h @@ -258,24 +258,6 @@ struct uverbs_object_tree_def { * Declaration helpers * ======================================= */ -#define _UVERBS_METHOD_ATTRS_SZ(...) \ - (sizeof((const struct uverbs_attr_def * const []){__VA_ARGS__}) /\ - sizeof(const struct uverbs_attr_def *)) -#define _UVERBS_METHOD(_id, _handler, _flags, ...) \ - ((const struct uverbs_method_def) { \ - .id = _id, \ - .flags = _flags, \ - .handler = _handler, \ - .num_attrs = _UVERBS_METHOD_ATTRS_SZ(__VA_ARGS__), \ - .attrs = &(const struct uverbs_attr_def * const []){__VA_ARGS__} }) -#define DECLARE_UVERBS_METHOD(_name, _id, _handler, ...) \ - const struct uverbs_method_def _name = \ - _UVERBS_METHOD(_id, _handler, 0, ##__VA_ARGS__) -#define DECLARE_UVERBS_CTX_METHOD(_name, _id, _handler, _flags, ...) \ - const struct uverbs_method_def _name = \ - _UVERBS_METHOD(_id, _handler, \ - UVERBS_ACTION_FLAG_CREATE_ROOT, \ - ##__VA_ARGS__) #define _UVERBS_OBJECT_METHODS_SZ(...) \ (sizeof((const struct uverbs_method_def * const []){__VA_ARGS__}) / \ sizeof(const struct uverbs_method_def *)) |