diff mbox series

[V2,net-next] mlxsw: spectrum_router: remove redundant initialization of pointer br_dev

Message ID 20200527081555.124615-1-colin.king@canonical.com
State Accepted
Delegated to: David Miller
Headers show
Series [V2,net-next] mlxsw: spectrum_router: remove redundant initialization of pointer br_dev | expand

Commit Message

Colin Ian King May 27, 2020, 8:15 a.m. UTC
From: Colin Ian King <colin.king@canonical.com>

The pointer br_dev is being initialized with a value that is never read
and is being updated with a new value later on. The initialization
is redundant and can be removed.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---

V2: remove stray blank line

---
 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Ido Schimmel May 27, 2020, 9 a.m. UTC | #1
On Wed, May 27, 2020 at 09:15:55AM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> The pointer br_dev is being initialized with a value that is never read
> and is being updated with a new value later on. The initialization
> is redundant and can be removed.
> 
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Reviewed-by: Ido Schimmel <idosch@mellanox.com>

Thanks
David Miller May 27, 2020, 6:23 p.m. UTC | #2
From: Colin King <colin.king@canonical.com>
Date: Wed, 27 May 2020 09:15:55 +0100

> From: Colin Ian King <colin.king@canonical.com>
> 
> The pointer br_dev is being initialized with a value that is never read
> and is being updated with a new value later on. The initialization
> is redundant and can be removed.
> 
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Applied.
diff mbox series

Patch

diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
index 71aee4914619..c425b78c6093 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
@@ -7572,7 +7572,7 @@  static struct mlxsw_sp_fid *
 mlxsw_sp_rif_vlan_fid_get(struct mlxsw_sp_rif *rif,
 			  struct netlink_ext_ack *extack)
 {
-	struct net_device *br_dev = rif->dev;
+	struct net_device *br_dev;
 	u16 vid;
 	int err;