All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sched/net/act: Remove temporary state variables
@ 2022-07-27  9:41 Li zeming
  2022-07-29  3:15 ` Jakub Kicinski
  0 siblings, 1 reply; 7+ messages in thread
From: Li zeming @ 2022-07-27  9:41 UTC (permalink / raw)
  To: jhs, xiyou.wangcong, jiri, davem, edumazet, kuba, pabeni
  Cc: netdev, linux-kernel, Li zeming

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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-07-29  8:11 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-27  9:41 [PATCH] sched/net/act: Remove temporary state variables Li zeming
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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.