From: Steven Rostedt <rostedt@goodmis.org>
To: Shuah Khan <skhan@linuxfoundation.org>
Cc: MottiKumar Babu <mottikumarbabu@gmail.com>,
mhiramat@kernel.org, mark.rutland@arm.com,
mathieu.desnoyers@efficios.com, linux-kernel@vger.kernel.org,
linux-trace-kernel@vger.kernel.org,
linux-kernel-mentees@lists.linux.dev, anupnewsmail@gmail.com
Subject: Re: [PATCH] Removed unnecessary initialization of "ret"
Date: Mon, 28 Oct 2024 01:14:49 -0400 [thread overview]
Message-ID: <20241028011449.68818eef@rorschach.local.home> (raw)
In-Reply-To: <5d87c8ba-8464-4d9c-9152-611097b5ae3e@linuxfoundation.org>
On Sun, 27 Oct 2024 21:24:55 -0600
Shuah Khan <skhan@linuxfoundation.org> wrote:
> > diff --git a/kernel/trace/fgraph.c b/kernel/trace/fgraph.c
> > index 69e226a48daa..b13ab2ad0e88 100644
> > --- a/kernel/trace/fgraph.c
> > +++ b/kernel/trace/fgraph.c
> > @@ -1249,7 +1249,7 @@ int register_ftrace_graph(struct fgraph_ops *gops)
> > {
> > static bool fgraph_initialized;
> > int command = 0;
> > - int ret = 0;
> > + int ret;
> > int i = -1;
> >
> > guard(mutex)(&ftrace_lock);
>
> It makes sense to initialize ret - i think you might see a warning about
> ret being not initialized before use. I don't see much value in saving
> unnecessary computation.
FYI, I'm rewriting this code for the next merge window, so this patch
doesn't need to be applied (as it's not something Linus would take in
an -rc release cycle).
-- Steve
prev parent reply other threads:[~2024-10-28 5:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-27 21:18 [PATCH] Removed unnecessary initialization of "ret" MottiKumar Babu
2024-10-28 3:24 ` Shuah Khan
2024-10-28 5:14 ` Steven Rostedt [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=20241028011449.68818eef@rorschach.local.home \
--to=rostedt@goodmis.org \
--cc=anupnewsmail@gmail.com \
--cc=linux-kernel-mentees@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mathieu.desnoyers@efficios.com \
--cc=mhiramat@kernel.org \
--cc=mottikumarbabu@gmail.com \
--cc=skhan@linuxfoundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox