From patchwork Mon Dec 19 14:43:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 9481431 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 951A5600CA for ; Tue, 20 Dec 2016 10:48:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 94B3428402 for ; Tue, 20 Dec 2016 10:48:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 89CBB28410; Tue, 20 Dec 2016 10:48:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9C2C328402 for ; Tue, 20 Dec 2016 10:48:41 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8616989836; Tue, 20 Dec 2016 10:48:40 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-pg0-x242.google.com (mail-pg0-x242.google.com [IPv6:2607:f8b0:400e:c05::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id E43976E0DC; Mon, 19 Dec 2016 14:44:01 +0000 (UTC) Received: by mail-pg0-x242.google.com with SMTP id p66so18690599pga.2; Mon, 19 Dec 2016 06:44:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=h7gI/R9iqNRX5JXz/0UrkWyAwYT25AplaVxtEit2xno=; b=KGStdkaMJXK0foLjb0Enlr+IJEKwpWOQ0L4yr6BHIyTMb1mj0pnZjUz+yfZnJeFXjt JY0y8i49fsjMknlfs966iRXvYsSQBZusRsckxZkyQAn8zZ6q2ThASUKNeFDjPo2FwpdJ Ls+QPqoFofPRGPc/BNjvUuFyADg1eYPvUWJwa612IYT89DLnwSyUun3CR4cyslbZmuOO YFHp1LdP5e4Mnvm+vE6r08BWgqMoSa0gu06FqAy/vtGYjm70qLOjbjZOVZvT0Fl8aDgr e2ngYHG6Q4hLu10idfFzURcL/zGDHgAcy+NS0/+UND+n2bd2wG79C1CMxhrqUPYopnyS et3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=h7gI/R9iqNRX5JXz/0UrkWyAwYT25AplaVxtEit2xno=; b=J8VQhY6A3+/UWJ6PfmwpZbrOuIY9bXQWYeEolh14WoAIYxg4QAcUI1lp+Zy0BmKtdB Fj+rEUwBje2gFUWUhox2F31kbFPT2ecr/3tVVSmyeAccjN532UA0ty1o62m56h25FBNE aGFsEO10xn1vQEXaxEGL0AsudfY7R1E1w1XIKIuKTnMT10U0NGpmQmi2gZO42mVOP02i gCSPs4MgRwnKoW3IVexzsZAcoHNvvayAHH1zelc6KzgMF5X5d/rWVS2mHQThtgtxSwxN bi65tibR2rImlO70hYGVr9INX4hXRo433p0oLmtY/K6PI9gerF6sTePgPaZpFCmutuF3 2g2w== X-Gm-Message-State: AKaTC024nBQW+sIvUyddFo3IDh3IxSwihst2yZ/MeR5dzvLoEXHAb5Gi/8e4vU0ywpTU5Q== X-Received: by 10.98.53.4 with SMTP id c4mr15391212pfa.45.1482158641345; Mon, 19 Dec 2016 06:44:01 -0800 (PST) Received: from localhost (li411-102.members.linode.com. [106.187.91.102]) by smtp.gmail.com with ESMTPSA id h185sm32121623pfg.90.2016.12.19.06.43.58 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 19 Dec 2016 06:44:00 -0800 (PST) From: Geliang Tang To: Daniel Vetter , Jani Nikula , David Airlie Date: Mon, 19 Dec 2016 22:43:49 +0800 Message-Id: <62ce937ae9a341421942b4418515610d055fa653.1482158544.git.geliangtang@gmail.com> X-Mailer: git-send-email 2.9.3 X-Mailman-Approved-At: Tue, 20 Dec 2016 10:48:38 +0000 Cc: Geliang Tang , intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: [Intel-gfx] [PATCH] drm/i915/debugfs: use rb_entry() X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP To make the code clearer, use rb_entry() instead of container_of() to deal with rbtree. Signed-off-by: Geliang Tang --- drivers/gpu/drm/i915/i915_debugfs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c index b77b53b..e04d9a1 100644 --- a/drivers/gpu/drm/i915/i915_debugfs.c +++ b/drivers/gpu/drm/i915/i915_debugfs.c @@ -686,7 +686,7 @@ static void i915_ring_seqno_info(struct seq_file *m, spin_lock_irq(&b->lock); for (rb = rb_first(&b->waiters); rb; rb = rb_next(rb)) { - struct intel_wait *w = container_of(rb, typeof(*w), node); + struct intel_wait *w = rb_entry(rb, typeof(*w), node); seq_printf(m, "Waiting (%s): %s [%d] on %x\n", engine->name, w->tsk->comm, w->tsk->pid, w->seqno); @@ -1336,7 +1336,7 @@ static int i915_hangcheck_info(struct seq_file *m, void *unused) &dev_priv->gpu_error.missed_irq_rings))); spin_lock_irq(&b->lock); for (rb = rb_first(&b->waiters); rb; rb = rb_next(rb)) { - struct intel_wait *w = container_of(rb, typeof(*w), node); + struct intel_wait *w = rb_entry(rb, typeof(*w), node); seq_printf(m, "\t%s [%d] waiting for %x\n", w->tsk->comm, w->tsk->pid, w->seqno); @@ -3252,7 +3252,7 @@ static int i915_engine_info(struct seq_file *m, void *unused) spin_lock_irq(&b->lock); for (rb = rb_first(&b->waiters); rb; rb = rb_next(rb)) { - struct intel_wait *w = container_of(rb, typeof(*w), node); + struct intel_wait *w = rb_entry(rb, typeof(*w), node); seq_printf(m, "\t%s [%d] waiting for %x\n", w->tsk->comm, w->tsk->pid, w->seqno);