]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
tracing: Remove redundant 0 value initialization
authorLiao Yuanhong <liaoyuanhong@vivo.com>
Mon, 25 Aug 2025 12:31:59 +0000 (20:31 +0800)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Tue, 23 Sep 2025 14:31:14 +0000 (10:31 -0400)
The saved_cmdlines_buffer struct is already zeroed by memset(). It's
redundant to initialize s->cmdline_idx to 0.

Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Link: https://lore.kernel.org/20250825123200.306272-1-liaoyuanhong@vivo.com
Signed-off-by: Liao Yuanhong <liaoyuanhong@vivo.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
kernel/trace/trace_sched_switch.c

index cb49f7279dc8043e6543fa71303c63d5d7544158..518dfc74347aff30584dd86f040ffd064de40d03 100644 (file)
@@ -224,7 +224,6 @@ static struct saved_cmdlines_buffer *allocate_cmdlines_buffer(unsigned int val)
        /* Place map_cmdline_to_pid array right after saved_cmdlines */
        s->map_cmdline_to_pid = (unsigned *)&s->saved_cmdlines[val * TASK_COMM_LEN];
 
-       s->cmdline_idx = 0;
        memset(&s->map_pid_to_cmdline, NO_CMDLINE_MAP,
               sizeof(s->map_pid_to_cmdline));
        memset(s->map_cmdline_to_pid, NO_CMDLINE_MAP,