]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
maple_dump: Pad better
authorMatthew Wilcox <willy@infradead.org>
Wed, 24 Apr 2019 17:03:27 +0000 (13:03 -0400)
committerLiam R. Howlett <Liam.Howlett@Oracle.com>
Wed, 31 Jul 2019 14:52:43 +0000 (10:52 -0400)
I think this works out better visually than the previous effort.

Signed-off-by: Matthew Wilcox <willy@infradead.org>
lib/maple_tree.c

index e20fd6cd471e1f2e0a2a5d8bfc12c8968a8a3888..39171f03058cccdfdbb3be172c4d2869e1ac54ea 100644 (file)
@@ -2189,10 +2189,11 @@ void mt_dump_node(void *entry, unsigned long min, unsigned long max,
                unsigned int depth);
 void mt_dump_range(unsigned long min, unsigned long max, unsigned int depth)
 {
+       static const char spaces[] = "                                ";
        if (min == max)
-               pr_info("%*lu: ", depth * 2 + 16, min);
+               pr_info("%.*s%lu: ", depth * 2, spaces, min);
        else
-               pr_info("%*lu-%lu: ", depth * 2 + 16, min, max);
+               pr_info("%.*s%lu-%lu: ", depth * 2, spaces, min, max);
 }
 
 void mt_dump_entry(void *entry, unsigned long min, unsigned long max,
@@ -2317,7 +2318,6 @@ void mt_dump_node(void *entry, unsigned long min, unsigned long max,
        default:
                pr_cont(" UNKNOWN TYPE\n");
        }
-       pr_info("dumped node %p\n", entry);
 }
 
 void mt_dump(const struct maple_tree *mt)