aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_mm.c
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2010-07-02 10:02:11 -0400
committerDave Airlie <airlied@redhat.com>2010-07-06 22:25:49 -0400
commit26f3751eb47c757c656333e74bdceccd8d286d76 (patch)
treed9c30006972a23f624069637af48171836d56956 /drivers/gpu/drm/drm_mm.c
parent815c4163b6c8ebf8152f42b0a5fd015cfdcedc78 (diff)
drm: use list_for_each_entry in drm_mm.c
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>
Diffstat (limited to 'drivers/gpu/drm/drm_mm.c')
-rw-r--r--drivers/gpu/drm/drm_mm.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/gpu/drm/drm_mm.c b/drivers/gpu/drm/drm_mm.c
index 2ac074c8f5d2..b75eb55f6084 100644
--- a/drivers/gpu/drm/drm_mm.c
+++ b/drivers/gpu/drm/drm_mm.c
@@ -332,7 +332,6 @@ struct drm_mm_node *drm_mm_search_free(const struct drm_mm *mm,
332 unsigned long size, 332 unsigned long size,
333 unsigned alignment, int best_match) 333 unsigned alignment, int best_match)
334{ 334{
335 struct list_head *list;
336 const struct list_head *free_stack = &mm->fl_entry; 335 const struct list_head *free_stack = &mm->fl_entry;
337 struct drm_mm_node *entry; 336 struct drm_mm_node *entry;
338 struct drm_mm_node *best; 337 struct drm_mm_node *best;
@@ -342,8 +341,7 @@ struct drm_mm_node *drm_mm_search_free(const struct drm_mm *mm,
342 best = NULL; 341 best = NULL;
343 best_size = ~0UL; 342 best_size = ~0UL;
344 343
345 list_for_each(list, free_stack) { 344 list_for_each_entry(entry, free_stack, fl_entry) {
346 entry = list_entry(list, struct drm_mm_node, fl_entry);
347 wasted = 0; 345 wasted = 0;
348 346
349 if (entry->size < size) 347 if (entry->size < size)
@@ -376,7 +374,6 @@ struct drm_mm_node *drm_mm_search_free_in_range(const struct drm_mm *mm,
376 unsigned long end, 374 unsigned long end,
377 int best_match) 375 int best_match)
378{ 376{
379 struct list_head *list;
380 const struct list_head *free_stack = &mm->fl_entry; 377 const struct list_head *free_stack = &mm->fl_entry;
381 struct drm_mm_node *entry; 378 struct drm_mm_node *entry;
382 struct drm_mm_node *best; 379 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 best = NULL; 383 best = NULL;
387 best_size = ~0UL; 384 best_size = ~0UL;
388 385
389 list_for_each(list, free_stack) { 386 list_for_each_entry(entry, free_stack, fl_entry) {
390 entry = list_entry(list, struct drm_mm_node, fl_entry);
391 wasted = 0; 387 wasted = 0;
392 388
393 if (entry->size < size) 389 if (entry->size < size)