From: Li zeming <zeming@nfschina.com>
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 <zeming@nfschina.com>
Subject: [PATCH] sched/net/act: Remove temporary state variables
Date: Wed, 27 Jul 2022 17:41:46 +0800 [thread overview]
Message-ID: <20220727094146.5990-1-zeming@nfschina.com> (raw)
The temporary variable ret could be removed and the corresponding state
can be directly returned.
Signed-off-by: Li zeming <zeming@nfschina.com>
---
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
next reply other threads:[~2022-07-27 9:42 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-27 9:41 Li zeming [this message]
2022-07-29 3:15 ` Jakub Kicinski
2022-07-29 6:30 ` Jiri Pirko
2022-07-29 6:51 ` Jakub Kicinski
2022-07-29 7:00 ` Jiri Pirko
2022-07-29 7:18 ` Jakub Kicinski
2022-07-29 8:11 ` Jiri Pirko
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=20220727094146.5990-1-zeming@nfschina.com \
--to=zeming@nfschina.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=xiyou.wangcong@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
all inboxes | Powered by JetHome®