Skip to contentSkip to conversation

iwlegacy: remove redundant variable len

PATCH In review Colin Ian King 3 participants 5 messages Nov 4, 2022 – Nov 8, 2022

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

PATCH 1/1 iwlegacy: remove redundant variable len

Variable len is being assigned and modified but it is never used. The variable is redundant and can be removed.

Cleans up clang scan build warning:
warning: variable 'len' set but not used [-Wunused-but-set-variable]

---
 drivers/net/wireless/intel/iwlegacy/3945-mac.c | 6 ------
 1 file changed, 6 deletions(-)
drivers/net/wireless/intel/iwlegacy/3945-mac.c +0 -6
index 7352d5b2095f..429952871976 100644
@@ -1202,8 +1202,6 @@ il3945_rx_handle(struct il_priv *il)
 		D_RX("r = %d, i = %d\n", r, i);
 
 	while (i != r) {
-		int len;
-
 		rxb = rxq->queue[i];
 
 		/* If an RXB doesn't have a Rx queue slot associated with it,
@@ -1217,10 +1215,6 @@ il3945_rx_handle(struct il_priv *il)
 			       PAGE_SIZE << il->hw_params.rx_page_order,
 			       DMA_FROM_DEVICE);
 		pkt = rxb_addr(rxb);
-
-		len = le32_to_cpu(pkt->len_n_flags) & IL_RX_FRAME_SIZE_MSK;
-		len += sizeof(u32);	/* account for status word */
-
 		reclaim = il_need_reclaim(il, pkt);
 
 		/* Based on type of command response or notification,
Signature · 1 line
2.38.1
#1 lore raw
Quoted 7 lines · Colin Ian King

Variable len is being assigned and modified but it is never used. The variable is redundant and can be removed.

Cleans up clang scan build warning:
warning: variable 'len' set but not used [-Wunused-but-set-variable]

For future wireless patches please add "wifi: " to the subject. I can edit the subject during commit so no need to resend.

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

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
#2 lore raw
Quoted 5 lines · Kalle Valo
Quoted 3 lines · Colin Ian King

Variable len is being assigned and modified but it is never used. The variable is redundant and can be removed.

Quoted 8 lines
Quoted 4 lines

Cleans up clang scan build warning:
warning: variable 'len' set but not used [-Wunused-but-set-variable]

For future wireless patches please add "wifi: " to the subject. I can edit the subject during commit so no need to resend.

OK, will try to remember to do that. Thanks for handling the $SUBJECT

Colin

#4 lore raw

Re: wifi: iwlegacy: remove redundant variable len

In reply to Colin Ian King
Quoted 8 lines · Colin Ian King

Variable len is being assigned and modified but it is never used. The variable is redundant and can be removed.

Cleans up clang scan build warning:
warning: variable 'len' set but not used [-Wunused-but-set-variable]

Patch applied to wireless-next.git, thanks.

9db485ce098f wifi: iwlegacy: remove redundant variable len

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

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