linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: xiakaixu1987@gmail.com
Cc: mingo@redhat.com, linux-kernel@vger.kernel.org,
	Kaixu Xia <kaixuxia@tencent.com>
Subject: Re: [PATCH] tracing: remove the unused value assignment in test_create_synth_event
Date: Fri, 13 Nov 2020 09:33:26 -0500	[thread overview]
Message-ID: <20201113093326.36f769de@gandalf.local.home> (raw)
In-Reply-To: <1605252810-4669-1-git-send-email-kaixuxia@tencent.com>

On Fri, 13 Nov 2020 15:33:30 +0800
xiakaixu1987@gmail.com wrote:

> From: Kaixu Xia <kaixuxia@tencent.com>
> 
> The value of variable ret is overwritten on the delete branch in the
> test_create_synth_event(), so here the value assignment is useless.
> Remove it.
> 

No. The correct fix is to remove the useless assignment of ret in the
delete portion. We care more about this error than we do about errors
happening in cleaning up the breakage.

-- Steve


> Reported-by: Tosk Robot <tencent_os_robot@tencent.com>
> Signed-off-by: Kaixu Xia <kaixuxia@tencent.com>
> ---
>  kernel/trace/synth_event_gen_test.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/kernel/trace/synth_event_gen_test.c b/kernel/trace/synth_event_gen_test.c
> index edd912cd14aa..c76b4c189560 100644
> --- a/kernel/trace/synth_event_gen_test.c
> +++ b/kernel/trace/synth_event_gen_test.c
> @@ -276,10 +276,8 @@ static int __init test_create_synth_event(void)
>  	 */
>  	create_synth_test = trace_get_event_file(NULL, "synthetic",
>  						 "create_synth_test");
> -	if (IS_ERR(create_synth_test)) {
> -		ret = PTR_ERR(create_synth_test);
> +	if (IS_ERR(create_synth_test))
>  		goto delete;
> -	}
>  
>  	/* Enable the event or you won't see anything */
>  	ret = trace_array_set_clr_event(create_synth_test->tr,


      reply	other threads:[~2020-11-13 14:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-13  7:33 [PATCH] tracing: remove the unused value assignment in test_create_synth_event xiakaixu1987
2020-11-13 14:33 ` 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=20201113093326.36f769de@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=kaixuxia@tencent.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=xiakaixu1987@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).