Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1192884pxb; Fri, 13 Nov 2020 06:37:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJzG+eD+lSZdDzGrPE2sbfnoy7IHtmzSAUoZeZjNfXySVI0jrdedn4NI4WCpOON4wMdxpd6Y X-Received: by 2002:a17:906:ccd3:: with SMTP id ot19mr2262671ejb.44.1605278261751; Fri, 13 Nov 2020 06:37:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605278261; cv=none; d=google.com; s=arc-20160816; b=ByQFd/VCsHWT9tc4XcGUmgzlDelbyZLEz+OchdLJCiNX32Qc4RushTYe2ZXFdhe7lK Bugs5lmucs5g3qbnRhBNtp8QrBraQ++GFWpI4cyGnEGP3dHha6UCV7Jx3UHmlAXh1amq +zfwdVO7EXDDkW1zGTzMVQ3/lsJzaV4C3TEyH4pXdRz4Cl+LxPsYTM5m9MJnsAmHQJK+ EUKQlRf6IEiTO8Qdy+a/CypOLHaOVIKwszzOQYQqX9/8Eqcnrd8W+MmffoBn8ikgz3UB E3rxh/ylrqHZyFJpxRQtPLwj7vQDbhQXJIuaLTITvwQ7XTqAUSR2LfRzasQ3A3PhGhDS X5Uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=D+hIMK2BcZYXLCcqVO1N8yuuq+z8Gmzg14x94t7Knqg=; b=yp1CCr2HTvdJlUz+xcVBj6/unL/UAMaaBSMVUIqQHCGwJrlqCi5sEXY87SOWig+Zw5 jQLZ62pt5gICivxBCes7mbnuA+oxJ1A+rj/lEh44loA2C/Z1NMACV5w8yQDUwQcNfTzA Qo8XCX/j4CDV0F5LuKMVM5QLG7XggrSw/h8j9tfZc4YKJotjiQlUAbGQHB19oije3p6R 1nPZ5Rky9GfMi0k1GNR8Ut4Ee0hiprGcOme59ELPRP5+B57Uhve4TKdcH1IY4MuW5m83 p3JZCoMm7hwwJ3SA+l8CVEQqQfSl4rGTF3wepo/gI75oKP7W1dPtu20XOLVlbP4f0iku x3WQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 4si6252189edh.521.2020.11.13.06.37.18; Fri, 13 Nov 2020 06:37:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726587AbgKMOd3 (ORCPT + 99 others); Fri, 13 Nov 2020 09:33:29 -0500 Received: from mail.kernel.org ([198.145.29.99]:34808 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726336AbgKMOd2 (ORCPT ); Fri, 13 Nov 2020 09:33:28 -0500 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E00212222F; Fri, 13 Nov 2020 14:33:27 +0000 (UTC) Date: Fri, 13 Nov 2020 09:33:26 -0500 From: Steven Rostedt To: xiakaixu1987@gmail.com Cc: mingo@redhat.com, linux-kernel@vger.kernel.org, Kaixu Xia Subject: Re: [PATCH] tracing: remove the unused value assignment in test_create_synth_event Message-ID: <20201113093326.36f769de@gandalf.local.home> In-Reply-To: <1605252810-4669-1-git-send-email-kaixuxia@tencent.com> References: <1605252810-4669-1-git-send-email-kaixuxia@tencent.com> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 13 Nov 2020 15:33:30 +0800 xiakaixu1987@gmail.com wrote: > From: Kaixu Xia > > 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 > Signed-off-by: Kaixu Xia > --- > 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,