Skip to contentSkip to conversation

carl9170: Remove redundant assignment to pointer super

PATCH In review Colin Ian King 3 participants 4 messages Feb 7, 2024 – Feb 14, 2024

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

PATCH 1/1 carl9170: Remove redundant assignment to pointer super

The pointer super is being assigned a value that is not being read, it is being re-assigned later. The assignment is redundant and can be removed.

Cleans up clang scan warning:
drivers/net/wireless/ath/carl9170/tx.c:192:34: warning: Value stored to 'super' during its initialization is never read [deadcode.DeadStores]

---
 drivers/net/wireless/ath/carl9170/tx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/ath/carl9170/tx.c +1 -1
index 6bb9aa2bfe65..e902ca80eba7 100644
@@ -189,7 +189,7 @@ static void carl9170_tx_accounting_free(struct ar9170 *ar, struct sk_buff *skb)
 
 static int carl9170_alloc_dev_space(struct ar9170 *ar, struct sk_buff *skb)
 {
-	struct _carl9170_tx_superframe *super = (void *) skb->data;
+	struct _carl9170_tx_superframe *super;
 	unsigned int chunks;
 	int cookie = -1;
 
Signature · 1 line
2.39.2
#1 lore raw
Quoted 9 lines · Colin Ian King

The pointer super is being assigned a value that is not being read, it is being re-assigned later. The assignment is redundant and can be removed.

Cleans up clang scan warning:
drivers/net/wireless/ath/carl9170/tx.c:192:34: warning: Value stored to 'super' during its initialization is never read [deadcode.DeadStores]

Same here, "wifi:" missing. I can add it, no need to resend because of this.

Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
Acked-by on v1 1/1
#2 lore raw
In reply to Colin Ian King
Quoted 9 lines · Colin Ian King

The pointer super is being assigned a value that is not being read, it is being re-assigned later. The assignment is redundant and can be removed.

Cleans up clang scan warning:
drivers/net/wireless/ath/carl9170/tx.c:192:34: warning: Value stored to 'super' during its initialization is never read [deadcode.DeadStores]

Quoted 17 lines
---
  drivers/net/wireless/ath/carl9170/tx.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/ath/carl9170/tx.c +1 -1
index 6bb9aa2bfe65..e902ca80eba7 100644
@@ -189,7 +189,7 @@ static void carl9170_tx_accounting_free(struct ar9170 *ar, struct sk_buff *skb)
 
  static int carl9170_alloc_dev_space(struct ar9170 *ar, struct sk_buff *skb)
  {
-	struct _carl9170_tx_superframe *super = (void *) skb->data;
+	struct _carl9170_tx_superframe *super;
  	unsigned int chunks;
  	int cookie = -1;
 
#3 lore raw
In reply to Colin Ian King
Quoted 4 lines · Colin Ian King

The pointer super is being assigned a value that is not being read, it is being re-assigned later. The assignment is redundant and can be removed.

Quoted 8 lines

Cleans up clang scan warning:

drivers/net/wireless/ath/carl9170/tx.c:192:34: warning: Value stored to 'super' during its initialization is never read [deadcode.DeadStores]

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

b53adefc884c wifi: carl9170: Remove redundant assignment to pointer super

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

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