Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp234088rdb; Sat, 30 Sep 2023 02:19:25 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFGaBV4uNP2PBT8z8iC4y0ZpJjWJdHxXo0HDg6U3ExhDtrZj94OmguQh/CUUEcYgI3Fr5lv X-Received: by 2002:a05:6808:208b:b0:3af:71cf:2b52 with SMTP id s11-20020a056808208b00b003af71cf2b52mr5316787oiw.27.1696065565553; Sat, 30 Sep 2023 02:19:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696065565; cv=none; d=google.com; s=arc-20160816; b=ADXx8B7GFKr8dy04lp7IoMNxkse9abKKNKB/s3MBsxTMlAv7wmv9kpnHIikwVw3pWy cwI1Sj0ZxzoiDz2F232PGhSOUOqmI3Rd464X+PR0SpC3etEfVrYHYQ/aGt/CTDGY9H7v o3WOZEiYgfj0RD6VwyIeKBr7RnmGB0ILophKo179MwPc0rtdR4gBPm+Aw0LaOsjnACo7 MK8kR2o32yFn/lbzjvjaRb4cGQLqTQcbdDPdU8bWym15YcbOynIm7XISEGal0C0C87ze wvp6Ib0GHhnfrqPzrowGaVqCaEycJ6xEqarEubRt7HNiS1nL1W9dfc4so8FOTxbholfD v2IA== 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 :dkim-signature; bh=5K9zvf9ymfxw0qCN1qfkM3nRvza7/8s34sIrXW7NUok=; fh=XCcktaBPN+rnuMzaZaYRChhYgPcnYp1Nf690knvpKgE=; b=yFCXpomeepor4PWbx5mfN4832EuLkDRQVYWFibs4uiVPsyQh0hmxTNJshcJhGriwqI UKmJCIYZPj2pyDebQ/pUMwJSGq5w/CPe0NZ/D5ovfx6FhNU7NrUkV1+tuMagAJz0o5p2 IVtIXu1D9iyXH3JAvcXYNrhFrDOistImwkfdyhfm02wotLRFimbC/wD3aC5abUN9Ethn dgy14QbkNCZ/486nOLYN3n2k3grTb0zgez5+RbhPzuHVe8vVSPQAPtK5rwJGIL7YCLQE F8Y0Mzqj1e6Wmq8XFEU5/0M0rnt/ydpnk3AOOVgDMYwezLC2ZakDBfAicA/KJvCCYS4S no5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fcQPwglQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id r5-20020a63fc45000000b0057744d09d1bsi22984793pgk.251.2023.09.30.02.19.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Sep 2023 02:19:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fcQPwglQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 5D2ED8090794; Sat, 30 Sep 2023 02:19:23 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233963AbjI3JTK (ORCPT + 99 others); Sat, 30 Sep 2023 05:19:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229588AbjI3JTJ (ORCPT ); Sat, 30 Sep 2023 05:19:09 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8BE5FB4; Sat, 30 Sep 2023 02:19:07 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 539E7C433C8; Sat, 30 Sep 2023 09:19:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696065546; bh=CVvQtHQSyndyWy/FagrIZcZBd171yHX/jAjEOxkaFf4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=fcQPwglQGQcQUubS/I9/SDHwTgwAtWcUJE/A/+7/Apn5w/5MSfMm+yUXs0mGXrpcO UZvuFt3yb/qYJmKf8dOOkp1eIBGyTUQokCOp+JHlURL5jZWdi7VLTRrrYuNL2bP5PU AxsMcFnAA9B//ObS3Chbf437dPquqf9tF66fq4KZcwfaHfMSXRvgcKiIpF3KD69iAW oBx4eKq9Fpizt0UmpjIXBC4ycRKhyS3cowb1PbvufahsVkrTxnXlp9HkKaL8fTmaA6 NqoSVSuLDXgJNKqYIZWlLRG8oniRZUNHxvl2StD3JL6YxvzdBNbhyJh5j3X9yPZIzF ELobq111PNfRg== Date: Sat, 30 Sep 2023 18:19:02 +0900 From: Masami Hiramatsu (Google) To: Julia Lawall Cc: Steven Rostedt , kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org Subject: Re: [PATCH] tracing/eprobe: drop unneeded breaks Message-Id: <20230930181902.eb1d089243deca0017046437@kernel.org> In-Reply-To: References: <20230928104334.41215-1-Julia.Lawall@inria.fr> <20230929203259.74d4ba263b3455172ef37f06@kernel.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Sat, 30 Sep 2023 02:19:23 -0700 (PDT) On Fri, 29 Sep 2023 13:37:08 +0200 (CEST) Julia Lawall wrote: > > > On Fri, 29 Sep 2023, Masami Hiramatsu wrote: > > > On Thu, 28 Sep 2023 12:43:34 +0200 > > Julia Lawall wrote: > > > > > Drop break after return. > > > > > > > Good catch! This looks good to me. > > > > Acked-by: Masami Hiramatsu (Google) > > > > 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 > > > > > > --- > > > 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) > > -- Masami Hiramatsu (Google)