Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1311639 > unrolled thread

[PATCH 1/5 v2] drm/i915: use hlist_for_each_entry

Started byGeliang Tang <geliangtang@163.com>
First post2016-01-18 17:00 +0100
Last post2016-01-18 17:50 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 1/5 v2] drm/i915: use hlist_for_each_entry Geliang Tang <geliangtang@163.com> - 2016-01-18 17:00 +0100
    Re: [Intel-gfx] [PATCH 1/5 v2] drm/i915: use hlist_for_each_entry Daniel Vetter <daniel@ffwll.ch> - 2016-01-18 17:50 +0100

#1311639 — [PATCH 1/5 v2] drm/i915: use hlist_for_each_entry

FromGeliang Tang <geliangtang@163.com>
Date2016-01-18 17:00 +0100
Subject[PATCH 1/5 v2] drm/i915: use hlist_for_each_entry
Message-ID<qSknM-2GX-15@gated-at.bofh.it>
Use hlist_for_each_entry() instead of hlist_for_each() to simplify
the code.

Signed-off-by: Geliang Tang <geliangtang@163.com>
---
Changes in v2:
 - Keep head = &eb->buckets[handle & eb->and]
---
 drivers/gpu/drm/i915/i915_gem_execbuffer.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

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

[toc] | [next] | [standalone]


#1311667 — Re: [Intel-gfx] [PATCH 1/5 v2] drm/i915: use hlist_for_each_entry

FromDaniel Vetter <daniel@ffwll.ch>
Date2016-01-18 17:50 +0100
SubjectRe: [Intel-gfx] [PATCH 1/5 v2] drm/i915: use hlist_for_each_entry
Message-ID<qSlaa-3jC-9@gated-at.bofh.it>
In reply to#1311639
On Mon, Jan 18, 2016 at 11:54:20PM +0800, Geliang Tang wrote:
> Use hlist_for_each_entry() instead of hlist_for_each() to simplify
> the code.
> 
> Signed-off-by: Geliang Tang <geliangtang@163.com>
> ---
> Changes in v2:
>  - Keep head = &eb->buckets[handle & eb->and]

Queued for -next, thanks for the patch.
-Daniel

> ---
>  drivers/gpu/drm/i915/i915_gem_execbuffer.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> index dccb517..7dc95a7 100644
> --- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> +++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> @@ -193,13 +193,10 @@ static struct i915_vma *eb_get_vma(struct eb_vmas *eb, unsigned long handle)
>  		return eb->lut[handle];
>  	} else {
>  		struct hlist_head *head;
> -		struct hlist_node *node;
> +		struct i915_vma *vma;
>  
>  		head = &eb->buckets[handle & eb->and];
> -		hlist_for_each(node, head) {
> -			struct i915_vma *vma;
> -
> -			vma = hlist_entry(node, struct i915_vma, exec_node);
> +		hlist_for_each_entry(vma, head, exec_node) {
>  			if (vma->exec_handle == handle)
>  				return vma;
>  		}
> -- 
> 2.5.0
> 
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web