Skip to contentSkip to conversation

mt7601u: Remove redundant initialization of variable ret

PATCH In review Colin King 3 participants 3 messages Oct 7, 2021 – Oct 13, 2021

Subsystems (5)
lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH 1/1 mt7601u: Remove redundant initialization of variable ret

From: Colin Ian King <[email protected]>

The variable ret is being initialized with a value that is never read, it is assigned later on with a different value. The initialization is redundant and can be removed.

Addresses-Coverity: ("Unused value")

---
 drivers/net/wireless/mediatek/mt7601u/dma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/mediatek/mt7601u/dma.c +1 -1
index ed78d2cb35e3..457147394edc 100644
@@ -515,7 +515,7 @@ static int mt7601u_alloc_tx(struct mt7601u_dev *dev)
 
 int mt7601u_dma_init(struct mt7601u_dev *dev)
 {
-	int ret = -ENOMEM;
+	int ret;
 
 	tasklet_setup(&dev->tx_tasklet, mt7601u_tx_tasklet);
 	tasklet_setup(&dev->rx_tasklet, mt7601u_rx_tasklet);
Signature · 1 line
2.32.0
Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · On Fri, 8 Oct 2021 00:41:53 +0100 Colin King wrote:

From: Colin Ian King <[email protected]>

The variable ret is being initialized with a value that is never read, it is assigned later on with a different value. The initialization is redundant and can be removed.

Addresses-Coverity: ("Unused value")

_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek

#2 lore raw
In reply to Colin King
Quoted 9 lines · Colin King

From: Colin Ian King <[email protected]>

The variable ret is being initialized with a value that is never read, it is assigned later on with a different value. The initialization is redundant and can be removed.

Addresses-Coverity: ("Unused value")

Patch applied to wireless-drivers-next.git, thanks.

3e4beec5e679 mt7601u: Remove redundant initialization of variable ret

Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches