[PATCH 2/2] maple_tree: dump error message based on format
From: Wei Yang
Date: Sun Aug 25 2024 - 21:24:51 EST
Just do what mt_dump_range64() does.
Dump the error message based on format.
Signed-off-by: Wei Yang <richard.weiyang@xxxxxxxxx>
---
lib/maple_tree.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/lib/maple_tree.c b/lib/maple_tree.c
index 236b58fd9be4..0c06a4c6d3bd 100644
--- a/lib/maple_tree.c
+++ b/lib/maple_tree.c
@@ -7217,9 +7217,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;
}
--
2.34.1