Skip to contentSkip to conversation

wifi: ath9k: remove redundant assignment to variable ret

PATCH In review Colin Ian King 3 participants 3 messages Jan 16, 2024 – Feb 2, 2024

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

PATCH 1/1 wifi: ath9k: remove redundant assignment to variable ret

The variable ret is being assigned a value but it isn't being read afterwards. The assignment is redundant and so ret can be removed.

Cleans up clang scan build warning:
warning: Although the value stored to 'ret' is used in the enclosing expression, the value is never actually read from 'ret' [deadcode.DeadStores]

---
 drivers/net/wireless/ath/ath9k/xmit.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/wireless/ath/ath9k/xmit.c +1 -2
index f15684379b03..d519b676a109 100644
@@ -369,12 +369,11 @@ static void ath_tid_drain(struct ath_softc *sc, struct ath_txq *txq,
 	struct list_head bf_head;
 	struct ath_tx_status ts;
 	struct ath_frame_info *fi;
-	int ret;
 
 	memset(&ts, 0, sizeof(ts));
 	INIT_LIST_HEAD(&bf_head);
 
-	while ((ret = ath_tid_dequeue(tid, &skb)) == 0) {
+	while (ath_tid_dequeue(tid, &skb) == 0) {
 		fi = get_frame_info(skb);
 		bf = fi->bf;
 
Signature · 1 line
2.39.2
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 10 lines · Colin Ian King

The variable ret is being assigned a value but it isn't being read afterwards. The assignment is redundant and so ret can be removed.

Cleans up clang scan build warning:
warning: Although the value stored to 'ret' is used in the enclosing expression, the value is never actually read from 'ret' [deadcode.DeadStores]

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

The variable ret is being assigned a value but it isn't being read afterwards. The assignment is redundant and so ret can be removed.

Quoted 8 lines

Cleans up clang scan build warning:
warning: Although the value stored to 'ret' is used in the enclosing expression, the value is never actually read from 'ret' [deadcode.DeadStores]

Patch applied to ath-next branch of ath.git, thanks.

08d82175bfbb wifi: ath9k: remove redundant assignment to variable ret

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

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