Commit 26f3751e authored by Daniel Vetter's avatar Daniel Vetter Committed by Dave Airlie

drm: use list_for_each_entry in drm_mm.c

Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Acked-by: default avatarThomas Hellstrom <thellstrom@vmwgfx.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 815c4163
...@@ -332,7 +332,6 @@ struct drm_mm_node *drm_mm_search_free(const struct drm_mm *mm, ...@@ -332,7 +332,6 @@ struct drm_mm_node *drm_mm_search_free(const struct drm_mm *mm,
unsigned long size, unsigned long size,
unsigned alignment, int best_match) unsigned alignment, int best_match)
{ {
struct list_head *list;
const struct list_head *free_stack = &mm->fl_entry; const struct list_head *free_stack = &mm->fl_entry;
struct drm_mm_node *entry; struct drm_mm_node *entry;
struct drm_mm_node *best; struct drm_mm_node *best;
...@@ -342,8 +341,7 @@ struct drm_mm_node *drm_mm_search_free(const struct drm_mm *mm, ...@@ -342,8 +341,7 @@ struct drm_mm_node *drm_mm_search_free(const struct drm_mm *mm,
best = NULL; best = NULL;
best_size = ~0UL; best_size = ~0UL;
list_for_each(list, free_stack) { list_for_each_entry(entry, free_stack, fl_entry) {
entry = list_entry(list, struct drm_mm_node, fl_entry);
wasted = 0; wasted = 0;
if (entry->size < size) if (entry->size < size)
...@@ -376,7 +374,6 @@ struct drm_mm_node *drm_mm_search_free_in_range(const struct drm_mm *mm, ...@@ -376,7 +374,6 @@ struct drm_mm_node *drm_mm_search_free_in_range(const struct drm_mm *mm,
unsigned long end, unsigned long end,
int best_match) int best_match)
{ {
struct list_head *list;
const struct list_head *free_stack = &mm->fl_entry; const struct list_head *free_stack = &mm->fl_entry;
struct drm_mm_node *entry; struct drm_mm_node *entry;
struct drm_mm_node *best; struct drm_mm_node *best;
...@@ -386,8 +383,7 @@ struct drm_mm_node *drm_mm_search_free_in_range(const struct drm_mm *mm, ...@@ -386,8 +383,7 @@ struct drm_mm_node *drm_mm_search_free_in_range(const struct drm_mm *mm,
best = NULL; best = NULL;
best_size = ~0UL; best_size = ~0UL;
list_for_each(list, free_stack) { list_for_each_entry(entry, free_stack, fl_entry) {
entry = list_entry(list, struct drm_mm_node, fl_entry);
wasted = 0; wasted = 0;
if (entry->size < size) if (entry->size < size)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment