Skip to contentSkip to conversation

drivers: net: smc91x: remove redundant initialization of pointer gpio

PATCH Applied Colin King 2 participants 2 messages Mar 26, 2021 – Mar 29, 2021

Subsystems (4)
lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH 1/1 drivers: net: smc91x: remove redundant initialization of pointer gpio

From: Colin Ian King <[email protected]>

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

Addresses-Coverity: ("Unused value")

---
 drivers/net/ethernet/smsc/smc91x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/smsc/smc91x.c +1 -1
index abd083efbfd7..bc19db2dbafb 100644
@@ -2205,7 +2205,7 @@ static int try_toggle_control_gpio(struct device *dev,
 				   const char *name, int index,
 				   int value, unsigned int nsdelay)
 {
-	struct gpio_desc *gpio = *desc;
+	struct gpio_desc *gpio;
 	enum gpiod_flags flags = value ? GPIOD_OUT_LOW : GPIOD_OUT_HIGH;
 
 	gpio = devm_gpiod_get_index_optional(dev, name, index, flags);
Signature · 1 line
2.30.2
#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 Fri, 26 Mar 2021 19:28:47 +0000 you wrote:

From: Colin Ian King <[email protected]>

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

Addresses-Coverity: ("Unused value")

[...]

Here is the summary with links:
- drivers: net: smc91x: remove redundant initialization of pointer gpio

    https://git.kernel.org/netdev/net-next/c/214037a146ff

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