Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp190112imn; Wed, 27 Jul 2022 03:43:28 -0700 (PDT) X-Google-Smtp-Source: AGRyM1ttN8UJEQ+/o6xfn2Z7aC/EZ+6NQqjouA0hLMAL/lqTwP5+igGBWhn0NGeGu3v7SNF9D41F X-Received: by 2002:a05:6a00:2407:b0:528:5bbc:aa0d with SMTP id z7-20020a056a00240700b005285bbcaa0dmr21068019pfh.40.1658918608352; Wed, 27 Jul 2022 03:43:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658918608; cv=none; d=google.com; s=arc-20160816; b=qT2h7hgECkYWnGhqBa89CmT7MnraYHWEOJDr8hXV6ZsoVd4Fa5ilZ0g6ubwFYtx5n3 zGDx/aBjOw5sdUEmPiI1DIvhEJ5u5nzMIKKuJA/KtulfHzeAFsORxTS8E31beMYtkcUY umUmmh9gyD47Wn7nTblHNrLbfgQBe1s/jSEAUVIf5Q80VUySBbQRlNFTM+t6tII9TdOQ MkCjGGXPD5IbiOh2qaM2sM5UINQ9vrLe9burBUHBGnbIZImgNNNh0lt0VDAjGht3IhzG o+73DXyFo2GdIbEmZNXMVFJp/thRazXGV+MyrknFNl3N+N7SvxpQy05iALmcHlg4miEp idAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=A8X0vR7hU1+xyv1CsBHz2+ykOYe6WMBuDTGA/JqgEvQ=; b=zp3/URnlhr5dBWWwOu5gQNh44wYOdFcSJd8QJHlemNg3tWfiagbaduDM3p9TNwFrCh 87umpz7T1+bemgtqJB2FEJwxgUU2KiGh35EmTugiaJHbOp8OK89oazed0Vzm7RTzyDol 2k1BW0ujzumaIBloa8lzhZc3i8p+yw6NEeQs7a68de0L13E5dn6WmknOerwIfR6++M2o u9gZ4TzudhPMtPnQYgvsO1KtA4Wb2VjbNTkgoN8uPPIQbBCQ0a2t0s6JvncaLpegzzI/ TgmDXHU3FnG/dCO4Ie3Eo6VvJsHaeC7pME0k+OrnmP5dcYmsYX60HKFUFXPw6cBMYCI7 HzDA== 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 f1-20020a170902ff0100b0016d83ed3d0bsi7087708plj.465.2022.07.27.03.43.13; Wed, 27 Jul 2022 03:43:28 -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 S229875AbiG0JmA (ORCPT + 99 others); Wed, 27 Jul 2022 05:42:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229763AbiG0Jl7 (ORCPT ); Wed, 27 Jul 2022 05:41:59 -0400 Received: from mail.nfschina.com (unknown [IPv6:2400:dd01:100f:2:72e2:84ff:fe10:5f45]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A9C23402CF; Wed, 27 Jul 2022 02:41:55 -0700 (PDT) Received: from localhost (unknown [127.0.0.1]) by mail.nfschina.com (Postfix) with ESMTP id 5C34C1E80D54; Wed, 27 Jul 2022 17:42:01 +0800 (CST) X-Virus-Scanned: amavisd-new at test.com Received: from mail.nfschina.com ([127.0.0.1]) by localhost (mail.nfschina.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yV9CtT5wv3fh; Wed, 27 Jul 2022 17:41:58 +0800 (CST) Received: from localhost.localdomain (unknown [219.141.250.2]) (Authenticated sender: zeming@nfschina.com) by mail.nfschina.com (Postfix) with ESMTPA id 8A3BE1E80D05; Wed, 27 Jul 2022 17:41:58 +0800 (CST) From: Li zeming To: jhs@mojatatu.com, xiyou.wangcong@gmail.com, jiri@resnulli.us, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Li zeming Subject: [PATCH] sched/net/act: Remove temporary state variables Date: Wed, 27 Jul 2022 17:41:46 +0800 Message-Id: <20220727094146.5990-1-zeming@nfschina.com> X-Mailer: git-send-email 2.18.2 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,RDNS_NONE, SPF_HELO_NONE,SPF_NONE autolearn=no 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 The temporary variable ret could be removed and the corresponding state can be directly returned. Signed-off-by: Li zeming --- net/sched/act_api.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/net/sched/act_api.c b/net/sched/act_api.c index 817065aa2833..34b5eb52e68b 100644 --- a/net/sched/act_api.c +++ b/net/sched/act_api.c @@ -398,8 +398,6 @@ static int __tcf_action_put(struct tc_action *p, bool bind) static int __tcf_idr_release(struct tc_action *p, bool bind, bool strict) { - int ret = 0; - /* Release with strict==1 and bind==0 is only called through act API * interface (classifiers always bind). Only case when action with * positive reference count and zero bind count can exist is when it was @@ -417,10 +415,10 @@ static int __tcf_idr_release(struct tc_action *p, bool bind, bool strict) return -EPERM; if (__tcf_action_put(p, bind)) - ret = ACT_P_DELETED; + return ACT_P_DELETED; } - return ret; + return 0; } int tcf_idr_release(struct tc_action *a, bool bind) -- 2.18.2