linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: mlx4: remove unneeded variable "err" in mlx4_en_ethtool_add_mac_rule()
@ 2020-05-07 11:08 Jason Yan
  2020-05-07 20:04 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Jason Yan @ 2020-05-07 11:08 UTC (permalink / raw)
  To: tariqt, davem, ast, daniel, kuba, hawk, john.fastabend, netdev,
	linux-rdma, linux-kernel, bpf
  Cc: Jason Yan

Fix the following coccicheck warning:

drivers/net/ethernet/mellanox/mlx4/en_ethtool.c:1396:5-8: Unneeded
variable: "err". Return "0" on line 1411

Signed-off-by: Jason Yan <yanaijie@huawei.com>
---
 drivers/net/ethernet/mellanox/mlx4/en_ethtool.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
index 216e6b2e9eed..b816154bc79a 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
@@ -1392,7 +1392,6 @@ static int mlx4_en_ethtool_add_mac_rule(struct ethtool_rxnfc *cmd,
 					struct mlx4_spec_list *spec_l2,
 					unsigned char *mac)
 {
-	int err = 0;
 	__be64 mac_msk = cpu_to_be64(MLX4_MAC_MASK << 16);
 
 	spec_l2->id = MLX4_NET_TRANS_RULE_ID_ETH;
@@ -1407,7 +1406,7 @@ static int mlx4_en_ethtool_add_mac_rule(struct ethtool_rxnfc *cmd,
 
 	list_add_tail(&spec_l2->list, rule_list_h);
 
-	return err;
+	return 0;
 }
 
 static int mlx4_en_ethtool_add_mac_rule_by_ipv4(struct mlx4_en_priv *priv,
-- 
2.21.1


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

* Re: [PATCH net-next] net: mlx4: remove unneeded variable "err" in mlx4_en_ethtool_add_mac_rule()
  2020-05-07 11:08 [PATCH net-next] net: mlx4: remove unneeded variable "err" in mlx4_en_ethtool_add_mac_rule() Jason Yan
@ 2020-05-07 20:04 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2020-05-07 20:04 UTC (permalink / raw)
  To: yanaijie
  Cc: tariqt, ast, daniel, kuba, hawk, john.fastabend, netdev,
	linux-rdma, linux-kernel, bpf

From: Jason Yan <yanaijie@huawei.com>
Date: Thu, 7 May 2020 19:08:57 +0800

> Fix the following coccicheck warning:
> 
> drivers/net/ethernet/mellanox/mlx4/en_ethtool.c:1396:5-8: Unneeded
> variable: "err". Return "0" on line 1411
> 
> Signed-off-by: Jason Yan <yanaijie@huawei.com>

Applied.

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

end of thread, other threads:[~2020-05-07 20:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-07 11:08 [PATCH net-next] net: mlx4: remove unneeded variable "err" in mlx4_en_ethtool_add_mac_rule() Jason Yan
2020-05-07 20:04 ` David Miller

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).