public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH 1/4] arm64: ptdump: use seq_puts() in pt_dump_seq_puts() macro
@ 2025-10-18 17:04 Josephine Pfeiffer
  2025-10-30 14:12 ` Will Deacon
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Josephine Pfeiffer @ 2025-10-18 17:04 UTC (permalink / raw)
  To: catalin.marinas, will; +Cc: linux-arm-kernel, linux-kernel

The pt_dump_seq_puts() macro incorrectly uses seq_printf() instead of
seq_puts(). This is both a performance issue and conceptually wrong,
as the macro name suggests plain string output (puts) but the
implementation uses formatted output (printf).

All call sites pass constant strings without format specifiers, so
using seq_printf() adds unnecessary overhead for format string parsing.

This bug was introduced in commit ae5d1cf358a5 ("arm64: dump: Make the
page table dumping seq_file optional") in 2016, where seq_puts() was
replaced with a new pt_dump_seq_puts() macro that mistakenly used
seq_printf().

Fixes: ae5d1cf358a5 ("arm64: dump: Make the page table dumping seq_file optional")
Signed-off-by: Josephine Pfeiffer <hi@josie.lol>
---
 arch/arm64/mm/ptdump.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/mm/ptdump.c b/arch/arm64/mm/ptdump.c
index ab9899ca1e5f..a35fcd62bf75 100644
--- a/arch/arm64/mm/ptdump.c
+++ b/arch/arm64/mm/ptdump.c
@@ -35,7 +35,7 @@
 #define pt_dump_seq_puts(m, fmt)	\
 ({					\
 	if (m)				\
-		seq_printf(m, fmt);	\
+		seq_puts(m, fmt);	\
 })
 
 static const struct ptdump_prot_bits pte_bits[] = {
-- 
2.51.1.dirty



^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-01-05 17:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-18 17:04 [PATCH 1/4] arm64: ptdump: use seq_puts() in pt_dump_seq_puts() macro Josephine Pfeiffer
2025-10-30 14:12 ` Will Deacon
2025-11-01 21:02   ` Josephine Pfeiffer
2025-12-11  9:50     ` Josephine Pfeiffer
2025-12-11 11:45 ` Anshuman Khandual
2026-01-05 17:11 ` Will Deacon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox