Thread (19 messages) flat view 19 messages, 6 authors, 2026-03-03

Re: [PATCH 01/12] powerpc/xive: simplify xive_spapr_debug_show()

From: Shrikanth Hegde <sshegde@linux.ibm.com>
Date: 2026-02-23 13:14:58
Also in: linux-arm-kernel, linux-fpga, linux-pm, lkml, netdev


On 2/19/26 11:43 PM, Yury Norov wrote:
quoted hunk ↗ jump to hunk
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 in seq_printf() directly with the "%*pbl" specifier.

Signed-off-by: Yury Norov <redacted>
---
  arch/powerpc/sysdev/xive/spapr.c | 12 ++----------
  1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/arch/powerpc/sysdev/xive/spapr.c b/arch/powerpc/sysdev/xive/spapr.c
index 5aedbe3e8e6a..f818299579b1 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;
  }
Looks good to me.

Reviewed-by: Shrikanth Hegde <sshegde@linux.ibm.com>

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help