[PATCH 4/8] module: replace seq_puts by seq_putc

From: Maxim Moskalets
Date: Tue Mar 26 2024 - 14:47:18 EST


Using seq_putc for single characters is faster and more appropriate
than seq_puts, since only one character is passed and there is no need
to use a more powerful and less fast function.

Signed-off-by: Maxim Moskalets <Maxim.Moskalets@xxxxxxxxxxxxx>
---
kernel/module/procfs.c | 4 ++--
kernel/module/tracking.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/kernel/module/procfs.c b/kernel/module/procfs.c
index 0a4841e88adb..dc91d3dba8f3 100644
--- a/kernel/module/procfs.c
+++ b/kernel/module/procfs.c
@@ -35,7 +35,7 @@ static inline void print_unload_info(struct seq_file *m, struct module *mod)
}

if (!printed_something)
- seq_puts(m, "-");
+ seq_putc(m, '-');
}
#else /* !CONFIG_MODULE_UNLOAD */
static inline void print_unload_info(struct seq_file *m, struct module *mod)
@@ -99,7 +99,7 @@ static int m_show(struct seq_file *m, void *p)
if (mod->taints)
seq_printf(m, " %s", module_flags(mod, buf, true));

- seq_puts(m, "\n");
+ seq_putc(m, '\n');
return 0;
}

diff --git a/kernel/module/tracking.c b/kernel/module/tracking.c
index 16742d1c630c..dcc4dc4c7501 100644
--- a/kernel/module/tracking.c
+++ b/kernel/module/tracking.c
@@ -95,7 +95,7 @@ static int unloaded_tainted_modules_seq_show(struct seq_file *m, void *p)
buf[l++] = '\0';

seq_printf(m, "%s (%s) %llu", mod_taint->name, buf, mod_taint->count);
- seq_puts(m, "\n");
+ seq_putc(m, '\n');

return 0;
}
--
2.39.2