drm: use list_for_each_entry in drm_mm.c
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 2 Jul 2010 14:02:11 +0000 (15:02 +0100)
committerDave Airlie <airlied@redhat.com>
Wed, 7 Jul 2010 02:25:49 +0000 (12:25 +1000)
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Thomas Hellstrom <thellstrom@vmwgfx.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/drm_mm.c

index 2ac074c8f5d2e546d40ff53fa3fe54c83547773d..b75eb55f6084d0fe1e3c34c1e2c94d4eaae0bbac 100644 (file)
@@ -332,7 +332,6 @@ struct drm_mm_node *drm_mm_search_free(const struct drm_mm *mm,
                                       unsigned long size,
                                       unsigned alignment, int best_match)
 {
-       struct list_head *list;
        const struct list_head *free_stack = &mm->fl_entry;
        struct drm_mm_node *entry;
        struct drm_mm_node *best;
@@ -342,8 +341,7 @@ struct drm_mm_node *drm_mm_search_free(const struct drm_mm *mm,
        best = NULL;
        best_size = ~0UL;
 
-       list_for_each(list, free_stack) {
-               entry = list_entry(list, struct drm_mm_node, fl_entry);
+       list_for_each_entry(entry, free_stack, fl_entry) {
                wasted = 0;
 
                if (entry->size < size)
@@ -376,7 +374,6 @@ struct drm_mm_node *drm_mm_search_free_in_range(const struct drm_mm *mm,
                                                unsigned long end,
                                                int best_match)
 {
-       struct list_head *list;
        const struct list_head *free_stack = &mm->fl_entry;
        struct drm_mm_node *entry;
        struct drm_mm_node *best;
@@ -386,8 +383,7 @@ struct drm_mm_node *drm_mm_search_free_in_range(const struct drm_mm *mm,
        best = NULL;
        best_size = ~0UL;
 
-       list_for_each(list, free_stack) {
-               entry = list_entry(list, struct drm_mm_node, fl_entry);
+       list_for_each_entry(entry, free_stack, fl_entry) {
                wasted = 0;
 
                if (entry->size < size)