summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/core/uverbs_std_types_dm.c
diff options
context:
space:
mode:
authorJason Gunthorpe2018-07-04 07:50:26 +0200
committerJason Gunthorpe2018-07-04 21:47:01 +0200
commit595c7736d48037d67e7926f5d3ebf484b95b1d13 (patch)
tree24961a06b5f83db6b638415fa575e5cd5d4115be /drivers/infiniband/core/uverbs_std_types_dm.c
parentRDMA/uverbs: Simplify UVERBS_ATTR family of macros (diff)
downloadkernel-qcow2-linux-595c7736d48037d67e7926f5d3ebf484b95b1d13.tar.gz
kernel-qcow2-linux-595c7736d48037d67e7926f5d3ebf484b95b1d13.tar.xz
kernel-qcow2-linux-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_dm.c')
-rw-r--r--drivers/infiniband/core/uverbs_std_types_dm.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/infiniband/core/uverbs_std_types_dm.c b/drivers/infiniband/core/uverbs_std_types_dm.c
index d294660a2e06..75ac20bed5e4 100644
--- a/drivers/infiniband/core/uverbs_std_types_dm.c
+++ b/drivers/infiniband/core/uverbs_std_types_dm.c
@@ -85,7 +85,7 @@ static int UVERBS_HANDLER(UVERBS_METHOD_DM_ALLOC)(struct ib_device *ib_dev,
return 0;
}
-static DECLARE_UVERBS_NAMED_METHOD(UVERBS_METHOD_DM_ALLOC,
+DECLARE_UVERBS_NAMED_METHOD(UVERBS_METHOD_DM_ALLOC,
&UVERBS_ATTR_IDR(UVERBS_ATTR_ALLOC_DM_HANDLE, UVERBS_OBJECT_DM,
UVERBS_ACCESS_NEW,
UA_FLAGS(UVERBS_ATTR_SPEC_F_MANDATORY)),
@@ -96,8 +96,7 @@ static DECLARE_UVERBS_NAMED_METHOD(UVERBS_METHOD_DM_ALLOC,
UVERBS_ATTR_TYPE(u32),
UA_FLAGS(UVERBS_ATTR_SPEC_F_MANDATORY)));
-static DECLARE_UVERBS_NAMED_METHOD_WITH_HANDLER(UVERBS_METHOD_DM_FREE,
- uverbs_destroy_def_handler,
+DECLARE_UVERBS_NAMED_METHOD_DESTROY(UVERBS_METHOD_DM_FREE,
&UVERBS_ATTR_IDR(UVERBS_ATTR_FREE_DM_HANDLE,
UVERBS_OBJECT_DM,
UVERBS_ACCESS_DESTROY,