mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
To: Julia Lawall <julia.lawall@inria.fr>
Cc: Steven Rostedt <rostedt@goodmis.org>,
	kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-trace-kernel@vger.kernel.org
Subject: Re: [PATCH] tracing/eprobe: drop unneeded breaks
Date: Sat, 30 Sep 2023 18:19:02 +0900	[thread overview]
Message-ID: <20230930181902.eb1d089243deca0017046437@kernel.org> (raw)
In-Reply-To: <alpine.DEB.2.22.394.2309291336260.3137@hadrien>

On Fri, 29 Sep 2023 13:37:08 +0200 (CEST)
Julia Lawall <julia.lawall@inria.fr> wrote:

> 
> 
> On Fri, 29 Sep 2023, Masami Hiramatsu  wrote:
> 
> > On Thu, 28 Sep 2023 12:43:34 +0200
> > Julia Lawall <Julia.Lawall@inria.fr> wrote:
> >
> > > Drop break after return.
> > >
> >
> > Good catch! This looks good to me.
> >
> > Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
> >
> > And
> >
> > Fixes: 7491e2c44278 ("tracing: Add a probe that attaches to trace events")
> 
> Thanks.  I didn't include that because it's not a bug.  But it does break
> Coccinelle, which is how I noticed it.

OK, I got it. I thought it may cause a compiler warning because the
'break' never be executed. (maybe it is just a flow-control word,
so it may not need to be warned, but a bit storange.)

> 
> julia
> 
> >
> > > Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>
> > >
> > > ---
> > >  kernel/trace/trace_eprobe.c |    5 +----
> > >  1 file changed, 1 insertion(+), 4 deletions(-)
> > >
> > > diff --git a/kernel/trace/trace_eprobe.c b/kernel/trace/trace_eprobe.c
> > > index 72714cbf475c..03c851f57969 100644
> > > --- a/kernel/trace/trace_eprobe.c
> > > +++ b/kernel/trace/trace_eprobe.c
> > > @@ -788,12 +788,9 @@ find_and_get_event(const char *system, const char *event_name)
> > >  		name = trace_event_name(tp_event);
> > >  		if (!name || strcmp(event_name, name))
> > >  			continue;
> > > -		if (!trace_event_try_get_ref(tp_event)) {
> > > +		if (!trace_event_try_get_ref(tp_event))
> > >  			return NULL;
> > > -			break;
> > > -		}
> > >  		return tp_event;
> > > -		break;
> > >  	}
> > >  	return NULL;
> > >  }
> > >
> >
> >
> > --
> > Masami Hiramatsu (Google) <mhiramat@kernel.org>
> >


-- 
Masami Hiramatsu (Google) <mhiramat@kernel.org>

  reply	other threads:[~2023-09-30  9:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-28 10:43 Julia Lawall
2023-09-29 11:32 ` Masami Hiramatsu
2023-09-29 11:37   ` Julia Lawall
2023-09-30  9:19     ` Masami Hiramatsu [this message]
2023-10-12 10:40       ` Dan Carpenter

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=20230930181902.eb1d089243deca0017046437@kernel.org \
    --to=mhiramat@kernel.org \
    --cc=julia.lawall@inria.fr \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®