Skip to contentSkip to conversation

octeontx2-af: Remove redundant initialization of variable pin

PATCH Applied Colin King 2 participants 2 messages Sep 29, 2021 – Sep 30, 2021

Subsystems (4)
lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH 1/1 octeontx2-af: Remove redundant initialization of variable pin

From: Colin Ian King <[email protected]>

The variable pin is being initialized with a value that is never read, it is being updated later on in only one case of a switch statement. The assignment is redundant and can be removed.

Addresses-Coverity: ("Unused value")

---
 drivers/net/ethernet/marvell/octeontx2/nic/otx2_ptp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/marvell/octeontx2/nic/otx2_ptp.c +1 -1
index 5e3056a89ee0..bc29ec834967 100644
@@ -194,7 +194,7 @@ static int otx2_ptp_enable(struct ptp_clock_info *ptp_info,
 {
 	struct otx2_ptp *ptp = container_of(ptp_info, struct otx2_ptp,
 					    ptp_info);
-	int pin = -1;
+	int pin;
 
 	if (!ptp->nic)
 		return -ENODEV;
Signature · 1 line
2.32.0
#1 lore raw
This patch was applied to netdev/net-next.git (refs/heads/master):

Hello:

This patch was applied to netdev/net-next.git (refs/heads/master):

Quoted 10 lines · On Wed, 29 Sep 2021 14:27:53 +0100 you wrote:

From: Colin Ian King <[email protected]>

The variable pin is being initialized with a value that is never read, it is being updated later on in only one case of a switch statement. The assignment is redundant and can be removed.

Addresses-Coverity: ("Unused value")

[...]

Here is the summary with links:
- [next] octeontx2-af: Remove redundant initialization of variable pin

    https://git.kernel.org/netdev/net-next/c/75f81afb27c3

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html