Skip to contentSkip to conversation

sfc: Remove redundant assignment of variable rc

PATCH In review Colin King 2 participants 2 messages Oct 7, 2021 – Oct 8, 2021

Subsystems (4)
lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH 1/1 sfc: Remove redundant assignment of variable rc

From: Colin Ian King <[email protected]>

The variable rc is being assigned a value that is never read, it is never accessed after the assignment. The assignment is redundant and can be removed.

Addresses-Coverity: ("Unused value")

---
 drivers/net/ethernet/sfc/ptp.c | 2 --
 1 file changed, 2 deletions(-)
drivers/net/ethernet/sfc/ptp.c +0 -2
index a39c5143b386..f5198d6a3d43 100644
@@ -1141,8 +1141,6 @@ static void efx_ptp_xmit_skb_mc(struct efx_nic *efx, struct sk_buff *skb)
 
 	skb_tstamp_tx(skb, &timestamps);
 
-	rc = 0;
-
 fail:
 	dev_kfree_skb_any(skb);
 
Signature · 1 line
2.32.0
#1 lore raw
Quoted 17 lines · Colin King

From: Colin Ian King <[email protected]>

The variable rc is being assigned a value that is never read, it is never accessed after the assignment. The assignment is redundant and can be removed.

Addresses-Coverity: ("Unused value")

---
 drivers/net/ethernet/sfc/ptp.c | 2 --
 1 file changed, 2 deletions(-)
drivers/net/ethernet/sfc/ptp.c +0 -0
index a39c5143b386..f5198d6a3d43 100644

drivers/net/ethernet/sfc/ptp.c static void efx_ptp_xmit_skb_mc(struct efx_nic *efx, struct sk_buff *skb) · line 1145

Quoted 5 lines
drivers/net/ethernet/sfc/ptp.c +0 -2
@@ -1141,8 +1141,6 @@ static void efx_ptp_xmit_skb_mc(struct efx_nic *efx, struct sk_buff *skb)
 
 	skb_tstamp_tx(skb, &timestamps);
 
-	rc = 0;
-

You can remove the initializer at the start of the function as well.

regards,
dan carpenter