net: mlx4: remove unneeded variable "err" in mlx4_en_ethtool_add_mac_rule()
authorJason Yan <yanaijie@huawei.com>
Thu, 7 May 2020 11:08:57 +0000 (19:08 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 7 May 2020 20:04:21 +0000 (13:04 -0700)
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx4/en_ethtool.c

index 216e6b2e9eed197e7edcadb7de7ca839327b05d0..b816154bc79a982312293c2f66dbeace9a618b7c 100644 (file)
@@ -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,