Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp912819imw; Fri, 15 Jul 2022 15:37:04 -0700 (PDT) X-Google-Smtp-Source: AGRyM1t4AzbDzmoLFny8NTKKm+/xdID6HQ+WXDOq2TOWttucP21wyb0XdrfBDHS44nkZkPn9A2X+ X-Received: by 2002:a62:8747:0:b0:52b:486a:50f with SMTP id i68-20020a628747000000b0052b486a050fmr2624188pfe.23.1657924623935; Fri, 15 Jul 2022 15:37:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657924623; cv=none; d=google.com; s=arc-20160816; b=HWKl4ro2QWm3bDpLNP2W9wwS4/awJ59BIvnhZE/V+7n46kWBTRIZXkvUZCnbYQEeN1 ygtLqNFu+nvHwkeAbPNHVRRtZ6K9MfIjz4XmlCOdBY0W+Oqn7mcDJOeRvfgVqswDVfXk jep0wo103F0YTKaK26mQ23fC8eV5L+YwvHvSY9kzqRfUFJk6TdkvnGD7kf9bp+ZSvcym yvTaMm+xVJMr51dzv1lXaIMJXSOTGamr3V4c7TB6HWXSd0O4+6Mn6/xBo8aGbliZxYVm rQfxK0tdSQ6sgwOilYGPVby3QL8rH96jxRqnlGVj3ENz3Dig/u3XFwQTtAqRxNp52954 sQ/A== 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=2lFw46foa9LR/A1Q+omPZ9yH5u+qh5Tm92xUrundHbg=; b=pk+aYOvz+6RhwKsAsZkaZxGktCxK3gxBU4dbdxKn/Ufejk2ZQu4UEnasFJveXZn+LT OH78A5dxFEPJzpcopWRWxhsc6HOBp2HWE9u/xGIKyiwmRhuWhOjPqn64wC8aqzRVfAn6 cawbH4TsB/GRVWNurk3+ucBdxMh0BVCN+6qu64jBwDT9GwLf+D/G4891LwgUgLw8qMCx ljm7Cwqfdn/NcKXBzcZpnE7bDMd5ok4rWXTnrPPisSvHCLGt9pGcUx8cNccebZ1T4jD4 nipNpQ0SPsGqHniH3U13zfTMiXvoXZy+YqUeEcJ6UOGkBE3vNe1aMJpZOBlGH6OhuAcy uXAw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m5-20020a170902f64500b0016a65a43611si6950713plg.149.2022.07.15.15.36.47; Fri, 15 Jul 2022 15:37:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230188AbiGOVuw (ORCPT + 99 others); Fri, 15 Jul 2022 17:50:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230012AbiGOVuu (ORCPT ); Fri, 15 Jul 2022 17:50:50 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8362F4F197; Fri, 15 Jul 2022 14:50:49 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id E5654CE31C2; Fri, 15 Jul 2022 21:50:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C064EC34115; Fri, 15 Jul 2022 21:50:44 +0000 (UTC) Date: Fri, 15 Jul 2022 17:50:43 -0400 From: Steven Rostedt To: Song Liu Cc: Song Liu , Networking , bpf , lkml , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Kernel Team , "jolsa@kernel.org" , "mhiramat@kernel.org" Subject: Re: [PATCH v2 bpf-next 3/5] ftrace: introduce FTRACE_OPS_FL_SHARE_IPMODIFY Message-ID: <20220715175043.03fa0d9f@gandalf.local.home> In-Reply-To: <019DBB19-E3BC-4EB5-8D96-DB1D0E10FD73@fb.com> References: <20220602193706.2607681-1-song@kernel.org> <20220602193706.2607681-4-song@kernel.org> <20220713203343.4997eb71@rorschach.local.home> <20220714204817.2889e280@rorschach.local.home> <6A7EF1C7-471B-4652-99C1-87C72C223C59@fb.com> <20220714224646.62d49e36@rorschach.local.home> <170BE89A-101C-4B25-A664-5E47A902DB83@fb.com> <0CE9BF90-B8CE-40F6-A431-459936157B78@fb.com> <20220715151217.141dc98f@gandalf.local.home> <0EB34157-8BCA-47FC-B78F-AA8FE45A1707@fb.com> <20220715155953.4fb692e2@gandalf.local.home> <6271DEDF-F585-4A3B-90BF-BA2EB76DDC01@fb.com> <20220715172919.76d60b47@gandalf.local.home> <019DBB19-E3BC-4EB5-8D96-DB1D0E10FD73@fb.com> X-Mailer: Claws Mail 3.17.8 (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=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 15 Jul 2022 21:48:21 +0000 Song Liu wrote: > >> int register_ftrace_function(struct ftrace_ops *ops) > >> + __releases(&direct_mutex) > >> { > >> + bool direct_mutex_locked; You'll need: bool direct_mutex_locked = false; obviously ;-) -- Steve > >> int ret; > >> > >> ftrace_ops_init(ops); > >> > >> + ret = prepare_direct_functions_for_ipmodify(ops); > >> + if (ret < 0) > >> + return ret; > >> + > >> + direct_mutex_locked = ret == 1; > >> + > > > > Please make the above: > > > > if (ret < 0) > > return ret; > > else if (ret == 1) > > direct_mutex_locked = true; > > > > It's much easier to read that way. > > Thanks for the clarification!