From: David Laight <david.laight.linux@gmail.com>
To: Colin Ian King <colin.i.king@gmail.com>
Cc: Steven Rostedt <rostedt@goodmis.org>,
Masami Hiramatsu <mhiramat@kernel.org>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
linux-trace-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ring-buffer: make the const read-only 'type' static
Date: Fri, 18 Jul 2025 22:24:48 +0100 [thread overview]
Message-ID: <20250718222448.13162080@pumpkin> (raw)
In-Reply-To: <20250714160858.1234719-1-colin.i.king@gmail.com>
On Mon, 14 Jul 2025 17:08:58 +0100
Colin Ian King <colin.i.king@gmail.com> wrote:
> Don't populate the read-only 'type' on the stack at run time,
> instead make it static.
>
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
> ---
> kernel/trace/ring_buffer.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
> index 00fc38d70e86..39aa1f50274f 100644
> --- a/kernel/trace/ring_buffer.c
> +++ b/kernel/trace/ring_buffer.c
> @@ -4118,7 +4118,7 @@ EXPORT_SYMBOL_GPL(ring_buffer_unlock_commit);
>
> static const char *show_irq_str(int bits)
> {
> - const char *type[] = {
> + static const char * type[] = {
Better would be:
static const char type[][4] = {
David
> ".", // 0
> "s", // 1
> "h", // 2
prev parent reply other threads:[~2025-07-18 21:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-14 16:08 [PATCH] ring-buffer: make the const read-only 'type' static Colin Ian King
2025-07-14 16:15 ` Steven Rostedt
2025-07-19 6:32 ` Christophe JAILLET
2025-07-18 21:24 ` David Laight [this message]
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=20250718222448.13162080@pumpkin \
--to=david.laight.linux@gmail.com \
--cc=colin.i.king@gmail.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=mhiramat@kernel.org \
--cc=rostedt@goodmis.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.