Skip to content

Commit a74f038

Browse files
pfeifferjPaul Walmsley
authored andcommitted
riscv: ptdump: use seq_puts() in pt_dump_seq_puts() macro
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). The macro is used in ptdump.c:301 to output a newline character. Using seq_printf() adds unnecessary overhead for format string parsing when outputting this constant string. This bug was introduced in commit 59c4da8 ("riscv: Add support to dump the kernel page tables") in 2020, which copied the implementation pattern from other architectures that had the same bug. Fixes: 59c4da8 ("riscv: Add support to dump the kernel page tables") Signed-off-by: Josephine Pfeiffer <hi@josie.lol> Link: https://lore.kernel.org/r/20251018170451.3355496-1-hi@josie.lol Signed-off-by: Paul Walmsley <pjw@kernel.org>
1 parent 060ea84 commit a74f038

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

arch/riscv/mm/ptdump.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#define pt_dump_seq_puts(m, fmt) \
2222
({ \
2323
if (m) \
24-
seq_printf(m, fmt); \
24+
seq_puts(m, fmt); \
2525
})
2626

2727
/*

0 commit comments

Comments
 (0)