]> www.infradead.org Git - users/willy/xarray.git/commitdiff
maple_tree: dump error message based on format
authorWei Yang <richard.weiyang@gmail.com>
Mon, 26 Aug 2024 01:24:22 +0000 (01:24 +0000)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 9 Sep 2024 23:39:01 +0000 (16:39 -0700)
Just do what mt_dump_range64() does.

Dump the error message based on format.

Link: https://lkml.kernel.org/r/20240826012422.29935-2-richard.weiyang@gmail.com
Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
Cc: Liam R. Howlett <Liam.Howlett@oracle.com>
Cc: Matthew Wilcox <willy@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
lib/maple_tree.c

index f7a971c462eb8eddc9e0c9d1f718b0fdca6a3e11..8a3c2c344f6290809a5f6a4e11fafd9ff7d6f07a 100644 (file)
@@ -7243,9 +7243,15 @@ static void mt_dump_arange64(const struct maple_tree *mt, void *entry,
                if (last == max)
                        break;
                if (last > max) {
-                       pr_err("node %p last (%lu) > max (%lu) at pivot %d!\n",
+                       switch(format) {
+                       case mt_dump_hex:
+                               pr_err("node %p last (%lx) > max (%lx) at pivot %d!\n",
                                        node, last, max, i);
-                       break;
+                               break;
+                       case mt_dump_dec:
+                               pr_err("node %p last (%lu) > max (%lu) at pivot %d!\n",
+                                       node, last, max, i);
+                       }
                }
                first = last + 1;
        }