Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934934AbcLTOD4 (ORCPT ); Tue, 20 Dec 2016 09:03:56 -0500 Received: from mail-pg0-f66.google.com ([74.125.83.66]:35005 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934542AbcLTODn (ORCPT ); Tue, 20 Dec 2016 09:03:43 -0500 From: Geliang Tang To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Sukadev Bhattiprolu , Alexey Kardashevskiy , David Gibson Cc: Geliang Tang , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH] powerpc/perf/24x7: use rb_entry Date: Tue, 20 Dec 2016 22:02:17 +0800 Message-Id: <38870b7604726c87e468f365ebe9236994c33f29.1482203132.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: 728 Lines: 23 To make the code clearer, use rb_entry() instead of container_of() to deal with rbtree. Signed-off-by: Geliang Tang --- arch/powerpc/perf/hv-24x7.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/perf/hv-24x7.c b/arch/powerpc/perf/hv-24x7.c index 7b2ca16..51bd3b4 100644 --- a/arch/powerpc/perf/hv-24x7.c +++ b/arch/powerpc/perf/hv-24x7.c @@ -547,7 +547,7 @@ static int event_uniq_add(struct rb_root *root, const char *name, int nl, struct event_uniq *it; int result; - it = container_of(*new, struct event_uniq, node); + it = rb_entry(*new, struct event_uniq, node); result = ev_uniq_ord(name, nl, domain, it->name, it->nl, it->domain); -- 2.9.3