netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] carl9170: remove redundant assignment to variable tx_params
@ 2022-01-23 18:27 Colin Ian King
  2022-01-24  8:22 ` Christian Lamparter
  0 siblings, 1 reply; 2+ messages in thread
From: Colin Ian King @ 2022-01-23 18:27 UTC (permalink / raw)
  To: Christian Lamparter, Kalle Valo, David S . Miller,
	Jakub Kicinski, linux-wireless, netdev
  Cc: kernel-janitors, linux-kernel

Variable tx_params is being assigned a value that is never read, it
is being re-assigned a couple of statements later with a different
value. The assignment is redundant and can be removed.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 drivers/net/wireless/ath/carl9170/main.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/net/wireless/ath/carl9170/main.c b/drivers/net/wireless/ath/carl9170/main.c
index 49f7ee1c912b..f392a2ac7e14 100644
--- a/drivers/net/wireless/ath/carl9170/main.c
+++ b/drivers/net/wireless/ath/carl9170/main.c
@@ -1909,8 +1909,6 @@ static int carl9170_parse_eeprom(struct ar9170 *ar)
 	tx_streams = hweight8(ar->eeprom.tx_mask);
 
 	if (rx_streams != tx_streams) {
-		tx_params = IEEE80211_HT_MCS_TX_RX_DIFF;
-
 		WARN_ON(!(tx_streams >= 1 && tx_streams <=
 			IEEE80211_HT_MCS_TX_MAX_STREAMS));
 
-- 
2.33.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] carl9170: remove redundant assignment to variable tx_params
  2022-01-23 18:27 [PATCH] carl9170: remove redundant assignment to variable tx_params Colin Ian King
@ 2022-01-24  8:22 ` Christian Lamparter
  0 siblings, 0 replies; 2+ messages in thread
From: Christian Lamparter @ 2022-01-24  8:22 UTC (permalink / raw)
  To: Colin Ian King, Christian Lamparter, Kalle Valo,
	David S . Miller, Jakub Kicinski, linux-wireless, netdev
  Cc: kernel-janitors, linux-kernel

On 23/01/2022 19:27, Colin Ian King wrote:
> Variable tx_params is being assigned a value that is never read, it
> is being re-assigned a couple of statements later with a different
> value. The assignment is redundant and can be removed.

I think you found a bug instead. This affects 1x2 AR9170 devices.
That IEEE80211_HT_MCS_TX_RX_DIFF capability flag should not be lost.

 From what I can tell, the next line (1917) after that WARN_ON(!(tx_streams >= ...)
that's still in the diff below:

                 tx_params = (tx_streams - 1) <<
                             IEEE80211_HT_MCS_TX_MAX_STREAMS_SHIFT;

needs a bitwise OR assignment operator instead of the direct assignment.

                 tx_params |= (tx_streams - 1) <<
                             IEEE80211_HT_MCS_TX_MAX_STREAMS_SHIFT;

can you please respin your patch and add stable?

Cheers,
Christian

> 
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
> ---
>   drivers/net/wireless/ath/carl9170/main.c | 2 --
>   1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/net/wireless/ath/carl9170/main.c b/drivers/net/wireless/ath/carl9170/main.c
> index 49f7ee1c912b..f392a2ac7e14 100644
> --- a/drivers/net/wireless/ath/carl9170/main.c
> +++ b/drivers/net/wireless/ath/carl9170/main.c
> @@ -1909,8 +1909,6 @@ static int carl9170_parse_eeprom(struct ar9170 *ar)
>   	tx_streams = hweight8(ar->eeprom.tx_mask);
>   
>   	if (rx_streams != tx_streams) {
> -		tx_params = IEEE80211_HT_MCS_TX_RX_DIFF;
> -
>   		WARN_ON(!(tx_streams >= 1 && tx_streams <=
>   			IEEE80211_HT_MCS_TX_MAX_STREAMS));
>   


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-01-24  8:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-23 18:27 [PATCH] carl9170: remove redundant assignment to variable tx_params Colin Ian King
2022-01-24  8:22 ` Christian Lamparter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).