Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934826AbcLTODv (ORCPT ); Tue, 20 Dec 2016 09:03:51 -0500 Received: from mail-pf0-f193.google.com ([209.85.192.193]:36113 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934545AbcLTODn (ORCPT ); Tue, 20 Dec 2016 09:03:43 -0500 From: Geliang Tang To: Santosh Shilimkar , "David S. Miller" Cc: Geliang Tang , netdev@vger.kernel.org, linux-rdma@vger.kernel.org, rds-devel@oss.oracle.com, linux-kernel@vger.kernel.org Subject: [PATCH] RDS: use rb_entry() Date: Tue, 20 Dec 2016 22:02:18 +0800 Message-Id: <2cd84448fe04ffb7023be892c5ed04bbfc759c87.1482204342.git.geliangtang@gmail.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 774 Lines: 23 To make the code clearer, use rb_entry() instead of container_of() to deal with rbtree. Signed-off-by: Geliang Tang --- net/rds/rdma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/rds/rdma.c b/net/rds/rdma.c index 4c93bad..ea96114 100644 --- a/net/rds/rdma.c +++ b/net/rds/rdma.c @@ -135,7 +135,7 @@ void rds_rdma_drop_keys(struct rds_sock *rs) /* Release any MRs associated with this socket */ spin_lock_irqsave(&rs->rs_rdma_lock, flags); while ((node = rb_first(&rs->rs_rdma_keys))) { - mr = container_of(node, struct rds_mr, r_rb_node); + mr = rb_entry(node, struct rds_mr, r_rb_node); if (mr->r_trans == rs->rs_transport) mr->r_invalidate = 0; rb_erase(&mr->r_rb_node, &rs->rs_rdma_keys); -- 2.9.3