Skip to content

Commit

Permalink
drm/i915/debugfs: use rb_entry()
Browse files Browse the repository at this point in the history
To make the code clearer, use rb_entry() instead of container_of() to
deal with rbtree.

Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/62ce937ae9a341421942b4418515610d055fa653.1482158544.git.geliangtang@gmail.com
  • Loading branch information
Geliang Tang authored and Daniel Vetter committed Dec 20, 2016
1 parent 5af7edc commit f802cf7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/gpu/drm/i915/i915_debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,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);
Expand Down Expand Up @@ -1329,7 +1329,7 @@ static int i915_hangcheck_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);
Expand Down Expand Up @@ -3261,7 +3261,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);
Expand Down

0 comments on commit f802cf7

Please sign in to comment.