[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20241028011449.68818eef@rorschach.local.home>
Date: Mon, 28 Oct 2024 01:14:49 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Shuah Khan <skhan@...uxfoundation.org>
Cc: MottiKumar Babu <mottikumarbabu@...il.com>, mhiramat@...nel.org,
mark.rutland@....com, mathieu.desnoyers@...icios.com,
linux-kernel@...r.kernel.org, linux-trace-kernel@...r.kernel.org,
linux-kernel-mentees@...ts.linux.dev, anupnewsmail@...il.com
Subject: Re: [PATCH] Removed unnecessary initialization of "ret"
On Sun, 27 Oct 2024 21:24:55 -0600
Shuah Khan <skhan@...uxfoundation.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
Powered by blists - more mailing lists