From: Leon Romanovsky <leonro@xxxxxxxxxxxx> Convert REQ retry count to new CM_GET/CM_SET macros. Signed-off-by: Leon Romanovsky <leonro@xxxxxxxxxxxx> --- drivers/infiniband/core/cm.c | 6 +++--- drivers/infiniband/core/cm_msgs.h | 12 ------------ 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c index b9eec4bf6419..ea3540cf9deb 100644 --- a/drivers/infiniband/core/cm.c +++ b/drivers/infiniband/core/cm.c @@ -1295,7 +1295,7 @@ static void cm_format_req(struct cm_req_msg *req_msg, if (param->qp_type != IB_QPT_XRC_INI) { CM_SET(REQ_RESPONDED_RESOURCES, req_msg, param->responder_resources); - cm_req_set_retry_count(req_msg, param->retry_count); + CM_SET(REQ_RETRY_COUNT, req_msg, param->retry_count); cm_req_set_rnr_retry_count(req_msg, param->rnr_retry_count); cm_req_set_srq(req_msg, param->srq); } @@ -1702,7 +1702,7 @@ static void cm_format_req_event(struct cm_work *work, param->flow_control = CM_GET(REQ_END_TO_END_FLOW_CONTROL, req_msg); param->remote_cm_response_timeout = CM_GET(REQ_LOCAL_CM_RESPONSE_TIMEOUT, req_msg); - param->retry_count = cm_req_get_retry_count(req_msg); + param->retry_count = CM_GET(REQ_RETRY_COUNT, req_msg); param->rnr_retry_count = cm_req_get_rnr_retry_count(req_msg); param->srq = cm_req_get_srq(req_msg); param->ppath_sgid_attr = cm_id_priv->av.ah_attr.grh.sgid_attr; @@ -2035,7 +2035,7 @@ static int cm_req_handler(struct cm_work *work) cm_id_priv->path_mtu = cm_req_get_path_mtu(req_msg); cm_id_priv->pkey = req_msg->pkey; cm_id_priv->sq_psn = CM_GET(REQ_STARTING_PSN, req_msg); - cm_id_priv->retry_count = cm_req_get_retry_count(req_msg); + cm_id_priv->retry_count = CM_GET(REQ_RETRY_COUNT, req_msg); cm_id_priv->rnr_retry_count = cm_req_get_rnr_retry_count(req_msg); cm_id_priv->qp_type = cm_req_get_qp_type(req_msg); diff --git a/drivers/infiniband/core/cm_msgs.h b/drivers/infiniband/core/cm_msgs.h index 2deaed83c9eb..ff7d4e9da833 100644 --- a/drivers/infiniband/core/cm_msgs.h +++ b/drivers/infiniband/core/cm_msgs.h @@ -400,18 +400,6 @@ struct cm_req_msg { } __packed; -static inline u8 cm_req_get_retry_count(struct cm_req_msg *req_msg) -{ - return (u8) (be32_to_cpu(req_msg->offset44) & 0x7); -} - -static inline void cm_req_set_retry_count(struct cm_req_msg *req_msg, - u8 retry_count) -{ - req_msg->offset44 = cpu_to_be32((retry_count & 0x7) | - (be32_to_cpu(req_msg->offset44) & 0xFFFFFFF8)); -} - static inline u8 cm_req_get_path_mtu(struct cm_req_msg *req_msg) { return req_msg->offset50 >> 4; -- 2.20.1