diff mbox series

[rdma-core,02/10] verbs: Add explicit arguments to DECLARE_CMD_BUFFER_COMPAT()

Message ID 20181122232416.30132-3-jgg@ziepe.ca (mailing list archive)
State Not Applicable
Headers show
Series Command execution rework | expand

Commit Message

Jason Gunthorpe Nov. 22, 2018, 11:24 p.m. UTC
From: Jason Gunthorpe <jgg@mellanox.com>

It is hard to read when this macro implicitly reaches into the argument
list to get the parameters. Type them again..

Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
---
 libibverbs/cmd_cq.c    | 8 ++++++--
 libibverbs/cmd_write.h | 3 ++-
 2 files changed, 8 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/libibverbs/cmd_cq.c b/libibverbs/cmd_cq.c
index 766951888e9f99..3406115559aaa7 100644
--- a/libibverbs/cmd_cq.c
+++ b/libibverbs/cmd_cq.c
@@ -119,7 +119,9 @@  int ibv_cmd_create_cq(struct ibv_context *context, int cqe,
 		      size_t cmd_size, struct ib_uverbs_create_cq_resp *resp,
 		      size_t resp_size)
 {
-	DECLARE_CMD_BUFFER_COMPAT(cmdb, UVERBS_OBJECT_CQ, UVERBS_METHOD_CQ_CREATE);
+	DECLARE_CMD_BUFFER_COMPAT(cmdb, UVERBS_OBJECT_CQ,
+				  UVERBS_METHOD_CQ_CREATE, cmd, cmd_size, resp,
+				  resp_size);
 
 	return ibv_icmd_create_cq(context, cqe, channel, comp_vector, 0, cq,
 				  cmdb);
@@ -133,7 +135,9 @@  int ibv_cmd_create_cq_ex(struct ibv_context *context,
 			 struct ib_uverbs_ex_create_cq_resp *resp,
 			 size_t resp_size)
 {
-	DECLARE_CMD_BUFFER_COMPAT(cmdb, UVERBS_OBJECT_CQ, UVERBS_METHOD_CQ_CREATE);
+	DECLARE_CMD_BUFFER_COMPAT(cmdb, UVERBS_OBJECT_CQ,
+				  UVERBS_METHOD_CQ_CREATE, cmd, cmd_size, resp,
+				  resp_size);
 	uint32_t flags = 0;
 
 	if (!check_comp_mask(cq_attr->comp_mask, IBV_CQ_INIT_ATTR_MASK_FLAGS))
diff --git a/libibverbs/cmd_write.h b/libibverbs/cmd_write.h
index 6ee4f30813bb67..98aa58a26d6728 100644
--- a/libibverbs/cmd_write.h
+++ b/libibverbs/cmd_write.h
@@ -98,7 +98,8 @@  void *_write_get_resp_ex(struct ibv_command_buffer *link,
 void _write_set_uhw(struct ibv_command_buffer *cmdb, const void *req,
 		    size_t core_req_size, size_t req_size, void *resp,
 		    size_t core_resp_size, size_t resp_size);
-#define DECLARE_CMD_BUFFER_COMPAT(_name, _object_id, _method_id)               \
+#define DECLARE_CMD_BUFFER_COMPAT(_name, _object_id, _method_id, cmd,          \
+				  cmd_size, resp, resp_size)                   \
 	DECLARE_COMMAND_BUFFER(_name, _object_id, _method_id, 2);              \
 	_write_set_uhw(_name, cmd, sizeof(*cmd), cmd_size, resp,               \
 		       sizeof(*resp), resp_size)