Commit 2bbd4492 authored by Daniel Vetter's avatar Daniel Vetter Committed by Dave Airlie

drm: mm: fix debug output

The looping helper didn't do anything due to a superficial
semicolon. Furthermore one of the two dump functions suffered
from copy&paste fail.

While staring at the code I've also noticed that the replace
helper (currently unused) is a bit broken.
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent ff68146a
...@@ -431,7 +431,7 @@ EXPORT_SYMBOL(drm_mm_search_free_in_range); ...@@ -431,7 +431,7 @@ EXPORT_SYMBOL(drm_mm_search_free_in_range);
void drm_mm_replace_node(struct drm_mm_node *old, struct drm_mm_node *new) void drm_mm_replace_node(struct drm_mm_node *old, struct drm_mm_node *new)
{ {
list_replace(&old->node_list, &new->node_list); list_replace(&old->node_list, &new->node_list);
list_replace(&old->node_list, &new->hole_stack); list_replace(&old->hole_stack, &new->hole_stack);
new->hole_follows = old->hole_follows; new->hole_follows = old->hole_follows;
new->mm = old->mm; new->mm = old->mm;
new->start = old->start; new->start = old->start;
...@@ -699,8 +699,8 @@ int drm_mm_dump_table(struct seq_file *m, struct drm_mm *mm) ...@@ -699,8 +699,8 @@ int drm_mm_dump_table(struct seq_file *m, struct drm_mm *mm)
entry->size); entry->size);
total_used += entry->size; total_used += entry->size;
if (entry->hole_follows) { if (entry->hole_follows) {
hole_start = drm_mm_hole_node_start(&mm->head_node); hole_start = drm_mm_hole_node_start(entry);
hole_end = drm_mm_hole_node_end(&mm->head_node); hole_end = drm_mm_hole_node_end(entry);
hole_size = hole_end - hole_start; hole_size = hole_end - hole_start;
seq_printf(m, "0x%08lx-0x%08lx: 0x%08lx: free\n", seq_printf(m, "0x%08lx-0x%08lx: 0x%08lx: free\n",
hole_start, hole_end, hole_size); hole_start, hole_end, hole_size);
......
...@@ -86,7 +86,7 @@ static inline bool drm_mm_initialized(struct drm_mm *mm) ...@@ -86,7 +86,7 @@ static inline bool drm_mm_initialized(struct drm_mm *mm)
} }
#define drm_mm_for_each_node(entry, mm) list_for_each_entry(entry, \ #define drm_mm_for_each_node(entry, mm) list_for_each_entry(entry, \
&(mm)->head_node.node_list, \ &(mm)->head_node.node_list, \
node_list); node_list)
#define drm_mm_for_each_scanned_node_reverse(entry, n, mm) \ #define drm_mm_for_each_scanned_node_reverse(entry, n, mm) \
for (entry = (mm)->prev_scanned_node, \ for (entry = (mm)->prev_scanned_node, \
next = entry ? list_entry(entry->node_list.next, \ next = entry ? list_entry(entry->node_list.next, \
......
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