Skip to contentSkip to conversation

net: fec_ptp: remove redundant initialization of variable val

PATCH Applied Colin Ian King 3 participants 3 messages Jan 23, 2022 – Jan 25, 2022

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: fec_ptp: remove redundant initialization of variable val

Variable val is being initialized with a value that is never read, it is being re-assigned later. The assignment is redundant and can be removed.

---
 drivers/net/ethernet/freescale/fec_ptp.c | 1 -
 1 file changed, 1 deletion(-)
drivers/net/ethernet/freescale/fec_ptp.c +0 -1
index af99017a5453..7d49c28215f3 100644
@@ -101,7 +101,6 @@ static int fec_ptp_enable_pps(struct fec_enet_private *fep, uint enable)
 	u32 val, tempval;
 	struct timespec64 ts;
 	u64 ns;
-	val = 0;
 
 	if (fep->pps_enable == enable)
 		return 0;
Signature · 1 line
2.33.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines

-----Original Message-----
From: Colin Ian King <[email protected]>
Sent: 2022年1月24日 2:50
To: Joakim Zhang <[email protected]>; David S . Miller <[email protected]>; Jakub Kicinski <[email protected]>; [email protected]
Cc: [email protected]; [email protected]
Subject: [PATCH] net: fec_ptp: remove redundant initialization of variable val

Quoted 4 lines

Variable val is being initialized with a value that is never read, it is being re-assigned later. The assignment is redundant and can be removed.

Looks good for me, so

Best Regards,
Joakim Zhang

Quoted 20 lines
---
 drivers/net/ethernet/freescale/fec_ptp.c | 1 -
 1 file changed, 1 deletion(-)
drivers/net/ethernet/freescale/fec_ptp.c +0 -1
index af99017a5453..7d49c28215f3 100644
@@ -101,7 +101,6 @@ static int fec_ptp_enable_pps(struct
 fec_enet_private *fep, uint enable)
 	u32 val, tempval;
 	struct timespec64 ts;
 	u64 ns;
-	val = 0;
 
 	if (fep->pps_enable == enable)

return 0;
--
2.33.1

#2 lore raw
In reply to Colin Ian King
This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:

Quoted 8 lines · On Sun, 23 Jan 2022 18:49:36 +0000 you wrote:

Variable val is being initialized with a value that is never read, it is being re-assigned later. The assignment is redundant and can be removed.

---
 drivers/net/ethernet/freescale/fec_ptp.c | 1 -
 1 file changed, 1 deletion(-)

Here is the summary with links:
- net: fec_ptp: remove redundant initialization of variable val

    https://git.kernel.org/netdev/net-next/c/6e667749271e

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html