Skip to contentSkip to conversation

android:ion: the order and count are in the wrong position

PATCH In review jun qian 2 participants 2 messages Sep 7, 2018 Staging

lore
Share & tools
lore

jun qian

author
#0 lore raw

PATCH 1/1 android:ion: the order and count are in the wrong position

The value in the wrong position will cause misunderstanding, when the debug infomations display in the window.

---
 drivers/staging/android/ion/ion_system_heap.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/android/ion/ion_system_heap.c +2 -2
index 701eb9f3b0f1..54b8a7710958 100644
@@ -225,10 +225,10 @@ static int ion_system_heap_debug_show(struct ion_heap *heap, struct seq_file *s,
 		pool = sys_heap->pools[i];
 
 		seq_printf(s, "%d order %u highmem pages %lu total\n",
-			   pool->high_count, pool->order,
+			   pool->order, pool->high_count,
 			   (PAGE_SIZE << pool->order) * pool->high_count);
 		seq_printf(s, "%d order %u lowmem pages %lu total\n",
-			   pool->low_count, pool->order,
+			   pool->order, pool->low_count,
 			   (PAGE_SIZE << pool->order) * pool->low_count);
 	}
 
Signature · 1 line
2.17.1
#1 lore raw
Quoted 3 lines · jun qian

The value in the wrong position will cause misunderstanding, when the debug infomations display in the window.

I think the existing order is okay, it's just not separated well. It's "$count pages of order $order". I also just acked a patch to remove all this code because it's dead on mainline anyway. For future work, we should look to make the debugfs output clearer to avoid ambiguity.

Thanks,
Laura

Quoted 23 lines
---
  drivers/staging/android/ion/ion_system_heap.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/android/ion/ion_system_heap.c +2 -2
index 701eb9f3b0f1..54b8a7710958 100644
@@ -225,10 +225,10 @@ static int ion_system_heap_debug_show(struct ion_heap *heap, struct seq_file *s,
  		pool = sys_heap->pools[i];
 
  		seq_printf(s, "%d order %u highmem pages %lu total\n",
-			   pool->high_count, pool->order,
+			   pool->order, pool->high_count,
  			   (PAGE_SIZE << pool->order) * pool->high_count);
  		seq_printf(s, "%d order %u lowmem pages %lu total\n",
-			   pool->low_count, pool->order,
+			   pool->order, pool->low_count,
  			   (PAGE_SIZE << pool->order) * pool->low_count);
  	}