Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934770AbcLTODu (ORCPT ); Tue, 20 Dec 2016 09:03:50 -0500 Received: from mail-pg0-f67.google.com ([74.125.83.67]:33965 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934524AbcLTODn (ORCPT ); Tue, 20 Dec 2016 09:03:43 -0500 From: Geliang Tang To: Stephen Hemminger , Jamal Hadi Salim , "David S. Miller" Cc: Geliang Tang , netem@lists.linux-foundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] net_sched: sch_netem: use rb_entry() Date: Tue, 20 Dec 2016 22:02:16 +0800 Message-Id: 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: 658 Lines: 23 To make the code clearer, use rb_entry() instead of container_of() to deal with rbtree. Signed-off-by: Geliang Tang --- net/sched/sch_netem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c index 9f7b380..b7e4097 100644 --- a/net/sched/sch_netem.c +++ b/net/sched/sch_netem.c @@ -152,7 +152,7 @@ struct netem_skb_cb { static struct sk_buff *netem_rb_to_skb(struct rb_node *rb) { - return container_of(rb, struct sk_buff, rbnode); + return rb_entry(rb, struct sk_buff, rbnode); } static inline struct netem_skb_cb *netem_skb_cb(struct sk_buff *skb) -- 2.9.3