]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
powerpc/xive: simplify xive_spapr_debug_show()
authorYury Norov <ynorov@nvidia.com>
Tue, 3 Mar 2026 20:08:37 +0000 (15:08 -0500)
committerYury Norov <ynorov@nvidia.com>
Thu, 9 Apr 2026 17:28:05 +0000 (13:28 -0400)
The function creates temporary buffer to convert xibm->bitmap to a
human-readable list before passing it to seq_printf. Drop it and print
the list by seq_printf() directly with the "%*pbl" specifier.

Reviewed-by: Shrikanth Hegde <sshegde@linux.ibm.com>
Acked-by: Madhavan Srinivasan <maddy@linux.ibm.com> for powerpc patch
Signed-off-by: Yury Norov <ynorov@nvidia.com>
arch/powerpc/sysdev/xive/spapr.c

index 61f8a8acf81f956aae3615fc1feef85863b3b64d..fdf52c78ac027c1277d4f4a88cb99c520084bbd0 100644 (file)
@@ -667,17 +667,9 @@ static void xive_spapr_sync_source(u32 hw_irq)
 static int xive_spapr_debug_show(struct seq_file *m, void *private)
 {
        struct xive_irq_bitmap *xibm;
-       char *buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
 
-       if (!buf)
-               return -ENOMEM;
-
-       list_for_each_entry(xibm, &xive_irq_bitmaps, list) {
-               memset(buf, 0, PAGE_SIZE);
-               bitmap_print_to_pagebuf(true, buf, xibm->bitmap, xibm->count);
-               seq_printf(m, "bitmap #%d: %s", xibm->count, buf);
-       }
-       kfree(buf);
+       list_for_each_entry(xibm, &xive_irq_bitmaps, list)
+               seq_printf(m, "bitmap #%d: %*pbl\n", xibm->count, xibm->count, xibm->bitmap);
 
        return 0;
 }