2015-11-25 13:23:54

by Geliang Tang

[permalink] [raw]
Subject: [PATCH] drm/mm: use list_next_entry

To make the intention clearer, use list_next_entry instead of list_entry.

Signed-off-by: Geliang Tang <[email protected]>
---
include/drm/drm_mm.h | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/include/drm/drm_mm.h b/include/drm/drm_mm.h
index a58cc6c..fc65118 100644
--- a/include/drm/drm_mm.h
+++ b/include/drm/drm_mm.h
@@ -148,8 +148,7 @@ static inline u64 drm_mm_hole_node_start(struct drm_mm_node *hole_node)

static inline u64 __drm_mm_hole_node_end(struct drm_mm_node *hole_node)
{
- return list_entry(hole_node->node_list.next,
- struct drm_mm_node, node_list)->start;
+ return list_next_entry(hole_node, node_list)->start;
}

/**
--
2.5.0


2015-11-25 15:23:19

by Daniel Vetter

[permalink] [raw]
Subject: Re: [PATCH] drm/mm: use list_next_entry

On Wed, Nov 25, 2015 at 09:23:07PM +0800, Geliang Tang wrote:
> To make the intention clearer, use list_next_entry instead of list_entry.
>
> Signed-off-by: Geliang Tang <[email protected]>

Applied to drm-misc, thanks.
-Daniel

> ---
> include/drm/drm_mm.h | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/include/drm/drm_mm.h b/include/drm/drm_mm.h
> index a58cc6c..fc65118 100644
> --- a/include/drm/drm_mm.h
> +++ b/include/drm/drm_mm.h
> @@ -148,8 +148,7 @@ static inline u64 drm_mm_hole_node_start(struct drm_mm_node *hole_node)
>
> static inline u64 __drm_mm_hole_node_end(struct drm_mm_node *hole_node)
> {
> - return list_entry(hole_node->node_list.next,
> - struct drm_mm_node, node_list)->start;
> + return list_next_entry(hole_node, node_list)->start;
> }
>
> /**
> --
> 2.5.0
>
>
> _______________________________________________
> dri-devel mailing list
> [email protected]
> http://lists.freedesktop.org/mailman/listinfo/dri-devel

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