From: Yury Norov Date: Tue, 3 Mar 2026 20:08:37 +0000 (-0500) Subject: powerpc/xive: simplify xive_spapr_debug_show() X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4ff568ce3ca66573e8b97b0caaa12b971dd38ae3;p=thirdparty%2Fkernel%2Flinux.git powerpc/xive: simplify xive_spapr_debug_show() 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 Acked-by: Madhavan Srinivasan for powerpc patch Signed-off-by: Yury Norov --- diff --git a/arch/powerpc/sysdev/xive/spapr.c b/arch/powerpc/sysdev/xive/spapr.c index 61f8a8acf81f9..fdf52c78ac027 100644 --- a/arch/powerpc/sysdev/xive/spapr.c +++ b/arch/powerpc/sysdev/xive/spapr.c @@ -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; }