public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Yury Norov <ynorov@nvidia.com>
To: linux-kernel@vger.kernel.org,
	"Christophe Leroy (CS GROUP)" <chleroy@kernel.org>,
	"Peter Zijlstra (Intel)" <peterz@infradead.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	"Alexander Shishkin" <alexander.shishkin@linux.intel.com>,
	"Daniel Lezcano" <daniel.lezcano@kernel.org>,
	"Ingo Molnar" <mingo@kernel.org>,
	"James Clark" <james.clark@linaro.org>,
	"Kees Cook" <kees@kernel.org>,
	"Lukasz Luba" <lukasz.luba@arm.com>,
	"Madhavan Srinivasan" <maddy@linux.ibm.com>,
	"Michael Ellerman" <mpe@ellerman.id.au>,
	"Mike Leach" <mike.leach@linaro.org>,
	"Moritz Fischer" <mdf@kernel.org>,
	"Nicholas Piggin" <npiggin@gmail.com>,
	"Russ Weight" <russ.weight@linux.dev>,
	"Shrikanth Hegde" <sshegde@linux.ibm.com>,
	"Suki K Poulose" <suzuki.poulose@arm.com>,
	"Tom Rix" <trix@redhat.com>,
	"Thomas Weißschuh" <linux@weissschuh.net>,
	"Xu Yilun" <yilun.xu@intel.com>,
	"Yury Norov" <yury.norov@gmail.com>,
	"Zhang Rui" <rui.zhang@intel.com>,
	coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org,
	linux-fpga@vger.kernel.org, linux-pm@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org, "Yury Norov" <ynorov@nvidia.com>
Cc: Jakub Kicinski <kuba@kernel.org>
Subject: [PATCH 1/5] powerpc/xive: simplify xive_spapr_debug_show()
Date: Tue,  3 Mar 2026 15:08:37 -0500	[thread overview]
Message-ID: <20260303200842.124996-2-ynorov@nvidia.com> (raw)
In-Reply-To: <20260303200842.124996-1-ynorov@nvidia.com>

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>
Signed-off-by: Yury Norov <ynorov@nvidia.com>
---
 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 61f8a8acf81f..fdf52c78ac02 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;
 }
-- 
2.43.0



  reply	other threads:[~2026-03-03 20:09 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-03 20:08 [PATCH RESEND 0/5] bitmap: cleanup bitmaps printing Yury Norov
2026-03-03 20:08 ` Yury Norov [this message]
2026-03-03 20:08 ` [PATCH 2/5] thermal: intel: switch cpumask_get() to using cpumask_print_to_pagebuf() Yury Norov
2026-03-03 20:08 ` [PATCH 3/5] coresight: don't use bitmap_print_to_pagebuf() Yury Norov
2026-03-03 20:08 ` [PATCH 4/5] lib/prime_numbers: drop temporary buffer in dump_primes() Yury Norov
2026-03-03 20:08 ` [PATCH 5/5] fpga: m10bmc-sec: switch show_canceled_csk() to using sysfs_emit() Yury Norov
2026-03-24  9:15   ` Xu Yilun
2026-03-24 18:38     ` Yury Norov
2026-03-25  7:25       ` Xu Yilun
2026-03-19 20:18 ` [PATCH RESEND 0/5] bitmap: cleanup bitmaps printing Yury Norov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260303200842.124996-2-ynorov@nvidia.com \
    --to=ynorov@nvidia.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=chleroy@kernel.org \
    --cc=coresight@lists.linaro.org \
    --cc=daniel.lezcano@kernel.org \
    --cc=james.clark@linaro.org \
    --cc=kees@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-fpga@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux@weissschuh.net \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=lukasz.luba@arm.com \
    --cc=maddy@linux.ibm.com \
    --cc=mdf@kernel.org \
    --cc=mike.leach@linaro.org \
    --cc=mingo@kernel.org \
    --cc=mpe@ellerman.id.au \
    --cc=npiggin@gmail.com \
    --cc=peterz@infradead.org \
    --cc=rafael@kernel.org \
    --cc=rui.zhang@intel.com \
    --cc=russ.weight@linux.dev \
    --cc=sshegde@linux.ibm.com \
    --cc=suzuki.poulose@arm.com \
    --cc=trix@redhat.com \
    --cc=yilun.xu@intel.com \
    --cc=yury.norov@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox