netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: dsa: sja1105: simplify the return expression of sja1105_cls_flower_stats()
@ 2022-04-29  5:52 cgel.zte
  2022-04-30  1:43 ` Jakub Kicinski
  0 siblings, 1 reply; 2+ messages in thread
From: cgel.zte @ 2022-04-29  5:52 UTC (permalink / raw)
  To: olteanv
  Cc: andrew, vivien.didelot, f.fainelli, davem, kuba, pabeni,
	linux-kernel, netdev, Minghao Chi, Zeal Robot

From: Minghao Chi <chi.minghao@zte.com.cn>

Simplify the return expression.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
---
 drivers/net/dsa/sja1105/sja1105_flower.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/net/dsa/sja1105/sja1105_flower.c b/drivers/net/dsa/sja1105/sja1105_flower.c
index fad5afe3819c..16c93159e475 100644
--- a/drivers/net/dsa/sja1105/sja1105_flower.c
+++ b/drivers/net/dsa/sja1105/sja1105_flower.c
@@ -501,7 +501,6 @@ int sja1105_cls_flower_stats(struct dsa_switch *ds, int port,
 {
 	struct sja1105_private *priv = ds->priv;
 	struct sja1105_rule *rule = sja1105_rule_find(priv, cls->cookie);
-	int rc;
 
 	if (!rule)
 		return 0;
@@ -509,12 +508,8 @@ int sja1105_cls_flower_stats(struct dsa_switch *ds, int port,
 	if (rule->type != SJA1105_RULE_VL)
 		return 0;
 
-	rc = sja1105_vl_stats(priv, port, rule, &cls->stats,
+	return sja1105_vl_stats(priv, port, rule, &cls->stats,
 			      cls->common.extack);
-	if (rc)
-		return rc;
-
-	return 0;
 }
 
 void sja1105_flower_setup(struct dsa_switch *ds)
-- 
2.25.1



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

end of thread, other threads:[~2022-04-30  1:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-29  5:52 [PATCH] net: dsa: sja1105: simplify the return expression of sja1105_cls_flower_stats() cgel.zte
2022-04-30  1:43 ` Jakub Kicinski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).