[PATCH] sfc: Remove redundant assignment of variable rc

Subsystems: networking drivers, sfc network driver, the rest

STALE1805d

2 messages, 2 authors, 2021-10-08 · open the first message on its own page

[PATCH] sfc: Remove redundant assignment of variable rc

From: Colin King <hidden>
Date: 2021-10-07 17:50:46

From: Colin Ian King <redacted>

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")
Signed-off-by: Colin Ian King <redacted>
---
 drivers/net/ethernet/sfc/ptp.c | 2 --
 1 file changed, 2 deletions(-)
diff --git a/drivers/net/ethernet/sfc/ptp.c b/drivers/net/ethernet/sfc/ptp.c
index a39c5143b386..f5198d6a3d43 100644
--- a/drivers/net/ethernet/sfc/ptp.c
+++ b/drivers/net/ethernet/sfc/ptp.c
@@ -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);
 
-- 
2.32.0

Re: [PATCH] sfc: Remove redundant assignment of variable rc

From: Dan Carpenter <hidden>
Date: 2021-10-08 05:33:46

On Thu, Oct 07, 2021 at 06:50:36PM +0100, Colin King wrote:
quoted hunk
From: Colin Ian King <redacted>

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")
Signed-off-by: Colin Ian King <redacted>
---
 drivers/net/ethernet/sfc/ptp.c | 2 --
 1 file changed, 2 deletions(-)
diff --git a/drivers/net/ethernet/sfc/ptp.c b/drivers/net/ethernet/sfc/ptp.c
index a39c5143b386..f5198d6a3d43 100644
--- a/drivers/net/ethernet/sfc/ptp.c
+++ b/drivers/net/ethernet/sfc/ptp.c
@@ -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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help