From: Maxim Moskalets <maximmosk4@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Maxim.Moskalets@kaspersky.com, bristot@redhat.com,
bsegall@google.com, dietmar.eggemann@arm.com,
juri.lelli@redhat.com, mgorman@suse.de, mingo@redhat.com,
peterz@infradead.org, rostedt@goodmis.org,
vincent.guittot@linaro.org, vschneid@redhat.com
Subject: [PATCH RESEND] kernel/sched: use seq_putc instead of seq_puts
Date: Thu, 7 Mar 2024 02:41:00 +0300 [thread overview]
Message-ID: <20240306234100.10356-1-Maxim.Moskalets@kaspersky.com> (raw)
Using seq_putc for newline 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@kaspersky.com>
---
kernel/sched/cpuacct.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/kernel/sched/cpuacct.c b/kernel/sched/cpuacct.c
index 0de9dda09949..54d9dd68f517 100644
--- a/kernel/sched/cpuacct.c
+++ b/kernel/sched/cpuacct.c
@@ -217,7 +217,7 @@ static int __cpuacct_percpu_seq_show(struct seq_file *m,
percpu = cpuacct_cpuusage_read(ca, i, index);
seq_printf(m, "%llu ", (unsigned long long) percpu);
}
- seq_printf(m, "\n");
+ seq_putc(m, '\n');
return 0;
}
@@ -245,14 +245,14 @@ static int cpuacct_all_seq_show(struct seq_file *m, void *V)
seq_puts(m, "cpu");
for (index = 0; index < CPUACCT_STAT_NSTATS; index++)
seq_printf(m, " %s", cpuacct_stat_desc[index]);
- seq_puts(m, "\n");
+ seq_putc(m, '\n');
for_each_possible_cpu(cpu) {
seq_printf(m, "%d", cpu);
for (index = 0; index < CPUACCT_STAT_NSTATS; index++)
seq_printf(m, " %llu",
cpuacct_cpuusage_read(ca, cpu, index));
- seq_puts(m, "\n");
+ seq_putc(m, '\n');
}
return 0;
}
--
2.34.1
reply other threads:[~2024-03-06 23:41 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20240306234100.10356-1-Maxim.Moskalets@kaspersky.com \
--to=maximmosk4@gmail.com \
--cc=Maxim.Moskalets@kaspersky.com \
--cc=bristot@redhat.com \
--cc=bsegall@google.com \
--cc=dietmar.eggemann@arm.com \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=vincent.guittot@linaro.org \
--cc=vschneid@redhat.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;
as well as URLs for NNTP newsgroup(s).