diff mbox

[rdma-core,3/5] mlx4: Don't nest container_of

Message ID 20171214223544.30117-4-jgg@ziepe.ca (mailing list archive)
State Not Applicable
Headers show

Commit Message

Jason Gunthorpe Dec. 14, 2017, 10:35 p.m. UTC
From: Jason Gunthorpe <jgg@mellanox.com>

Makes no sense, just use the full path to the substructure member.

Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
---
 providers/mlx4/mlx4.h | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
diff mbox

Patch

diff --git a/providers/mlx4/mlx4.h b/providers/mlx4/mlx4.h
index ef0c7cb9c9a733..a71e42f5c6e25f 100644
--- a/providers/mlx4/mlx4.h
+++ b/providers/mlx4/mlx4.h
@@ -275,14 +275,12 @@  static inline struct mlx4_cq *to_mcq(struct ibv_cq *ibcq)
 
 static inline struct mlx4_srq *to_msrq(struct ibv_srq *ibsrq)
 {
-	return container_of(container_of(ibsrq, struct verbs_srq, srq),
-			    struct mlx4_srq, verbs_srq);
+	return container_of(ibsrq, struct mlx4_srq, verbs_srq.srq);
 }
 
 static inline struct mlx4_qp *to_mqp(struct ibv_qp *ibqp)
 {
-	return container_of(container_of(ibqp, struct verbs_qp, qp),
-			    struct mlx4_qp, verbs_qp);
+	return container_of(ibqp, struct mlx4_qp, verbs_qp.qp);
 }
 
 static inline struct mlx4_qp *wq_to_mqp(struct ibv_wq *ibwq)