The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH 1/5] drm/i915: use hlist_for_each_entry
@ 2016-01-13 14:48 Geliang Tang
  2016-01-13 14:48 ` [PATCH 2/5] drm/i915: use kobj_to_dev() Geliang Tang
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Geliang Tang @ 2016-01-13 14:48 UTC (permalink / raw)
  To: Daniel Vetter, Jani Nikula, David Airlie
  Cc: Geliang Tang, intel-gfx, dri-devel, linux-kernel

Use hlist_for_each_entry() instead of hlist_for_each() to simplify
the code.

Signed-off-by: Geliang Tang <geliangtang@163.com>
---
 drivers/gpu/drm/i915/i915_gem_execbuffer.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
index 5d01ea6..8f194be 100644
--- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
@@ -192,14 +192,10 @@ static struct i915_vma *eb_get_vma(struct eb_vmas *eb, unsigned long handle)
 			return NULL;
 		return eb->lut[handle];
 	} else {
-		struct hlist_head *head;
-		struct hlist_node *node;
-
-		head = &eb->buckets[handle & eb->and];
-		hlist_for_each(node, head) {
-			struct i915_vma *vma;
+		struct i915_vma *vma;
 
-			vma = hlist_entry(node, struct i915_vma, exec_node);
+		hlist_for_each_entry(vma, &eb->buckets[handle & eb->and],
+				     exec_node) {
 			if (vma->exec_handle == handle)
 				return vma;
 		}
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2016-01-18 16:49 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-13 14:48 [PATCH 1/5] drm/i915: use hlist_for_each_entry Geliang Tang
2016-01-13 14:48 ` [PATCH 2/5] drm/i915: use kobj_to_dev() Geliang Tang
2016-01-13 15:42   ` [Intel-gfx] " Daniel Vetter
2016-01-13 14:48 ` [PATCH 3/5] drm/sysfs: " Geliang Tang
2016-01-13 15:43   ` Daniel Vetter
2016-01-13 14:48 ` [PATCH 4/5] drm/amdgpu: " Geliang Tang
2016-01-13 14:48 ` [PATCH 5/5] drm/radeon: " Geliang Tang
2016-01-13 17:17   ` Alex Deucher
2016-01-13 15:12 ` [Intel-gfx] [PATCH 1/5] drm/i915: use hlist_for_each_entry Chris Wilson
2016-01-18 15:54   ` [PATCH 1/5 v2] " Geliang Tang
2016-01-18 16:49     ` [Intel-gfx] " Daniel Vetter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox