diff mbox series

rtlwifi: rtl8192ee: remove static variable stop_report_cnt

Message ID 20221031155637.871164-1-colin.i.king@gmail.com (mailing list archive)
State Accepted
Commit cdeee85409526cf5a4ca6528bd4d148833a940a3
Delegated to: Kalle Valo
Headers show
Series rtlwifi: rtl8192ee: remove static variable stop_report_cnt | expand

Commit Message

Colin Ian King Oct. 31, 2022, 3:56 p.m. UTC
Variable stop_report_cnt is being set or incremented but is never
being used for anything meaningful. The variable and code relating
to it's use is redundant and can be removed.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 drivers/net/wireless/realtek/rtlwifi/rtl8192ee/trx.c | 8 --------
 1 file changed, 8 deletions(-)

Comments

Ping-Ke Shih Nov. 1, 2022, 12:22 a.m. UTC | #1
> -----Original Message-----
> From: Colin Ian King <colin.i.king@gmail.com>
> Sent: Monday, October 31, 2022 11:57 PM
> To: Ping-Ke Shih <pkshih@realtek.com>; Kalle Valo <kvalo@kernel.org>; David S . Miller
> <davem@davemloft.net>; Eric Dumazet <edumazet@google.com>; Jakub Kicinski <kuba@kernel.org>; Paolo Abeni
> <pabeni@redhat.com>; linux-wireless@vger.kernel.org; netdev@vger.kernel.org
> Cc: kernel-janitors@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: [PATCH] rtlwifi: rtl8192ee: remove static variable stop_report_cnt
> 
> Variable stop_report_cnt is being set or incremented but is never
> being used for anything meaningful. The variable and code relating
> to it's use is redundant and can be removed.
> 
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>

Acked-by: Ping-Ke Shih <pkshih@realtek.com>

> ---
>  drivers/net/wireless/realtek/rtlwifi/rtl8192ee/trx.c | 8 --------
>  1 file changed, 8 deletions(-)
> 
> diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/trx.c
> b/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/trx.c
> index 8043d819fb85..a182cdeb58e2 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/trx.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/trx.c
> @@ -997,7 +997,6 @@ bool rtl92ee_is_tx_desc_closed(struct ieee80211_hw *hw, u8 hw_queue, u16 index)
>  	struct rtl_priv *rtlpriv = rtl_priv(hw);
>  	u16 read_point, write_point;
>  	bool ret = false;
> -	static u8 stop_report_cnt;
>  	struct rtl8192_tx_ring *ring = &rtlpci->tx_ring[hw_queue];
> 
>  	{
> @@ -1038,13 +1037,6 @@ bool rtl92ee_is_tx_desc_closed(struct ieee80211_hw *hw, u8 hw_queue, u16 index)
>  	    rtlpriv->psc.rfoff_reason > RF_CHANGE_BY_PS)
>  		ret = true;
> 
> -	if (hw_queue < BEACON_QUEUE) {
> -		if (!ret)
> -			stop_report_cnt++;
> -		else
> -			stop_report_cnt = 0;
> -	}
> -
>  	return ret;
>  }
> 
> --
> 2.37.3
> 
> 
> ------Please consider the environment before printing this e-mail.
Ping-Ke Shih Nov. 1, 2022, 6:41 a.m. UTC | #2
> -----Original Message-----
> From: Ping-Ke Shih
> Sent: Tuesday, November 1, 2022 8:22 AM
> To: 'Colin Ian King' <colin.i.king@gmail.com>; Kalle Valo <kvalo@kernel.org>; David S . Miller
> <davem@davemloft.net>; Eric Dumazet <edumazet@google.com>; Jakub Kicinski <kuba@kernel.org>; Paolo Abeni
> <pabeni@redhat.com>; linux-wireless@vger.kernel.org; netdev@vger.kernel.org
> Cc: kernel-janitors@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: RE: [PATCH] rtlwifi: rtl8192ee: remove static variable stop_report_cnt
> 
> 
> > -----Original Message-----
> > From: Colin Ian King <colin.i.king@gmail.com>
> > Sent: Monday, October 31, 2022 11:57 PM
> > To: Ping-Ke Shih <pkshih@realtek.com>; Kalle Valo <kvalo@kernel.org>; David S . Miller
> > <davem@davemloft.net>; Eric Dumazet <edumazet@google.com>; Jakub Kicinski <kuba@kernel.org>; Paolo Abeni
> > <pabeni@redhat.com>; linux-wireless@vger.kernel.org; netdev@vger.kernel.org
> > Cc: kernel-janitors@vger.kernel.org; linux-kernel@vger.kernel.org
> > Subject: [PATCH] rtlwifi: rtl8192ee: remove static variable stop_report_cnt

Subject prefix should be "wifi: rtlwifi: ..."

I'm not sure if Kalle can help this, or you can send v2 to add prefix.

> >
> > Variable stop_report_cnt is being set or incremented but is never
> > being used for anything meaningful. The variable and code relating
> > to it's use is redundant and can be removed.
> >
> > Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
> 
> Acked-by: Ping-Ke Shih <pkshih@realtek.com>
> 
> > ---
> >  drivers/net/wireless/realtek/rtlwifi/rtl8192ee/trx.c | 8 --------
> >  1 file changed, 8 deletions(-)
> >
> > diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/trx.c
> > b/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/trx.c
> > index 8043d819fb85..a182cdeb58e2 100644
> > --- a/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/trx.c
> > +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/trx.c
> > @@ -997,7 +997,6 @@ bool rtl92ee_is_tx_desc_closed(struct ieee80211_hw *hw, u8 hw_queue, u16 index)
> >  	struct rtl_priv *rtlpriv = rtl_priv(hw);
> >  	u16 read_point, write_point;
> >  	bool ret = false;
> > -	static u8 stop_report_cnt;
> >  	struct rtl8192_tx_ring *ring = &rtlpci->tx_ring[hw_queue];
> >
> >  	{
> > @@ -1038,13 +1037,6 @@ bool rtl92ee_is_tx_desc_closed(struct ieee80211_hw *hw, u8 hw_queue, u16 index)
> >  	    rtlpriv->psc.rfoff_reason > RF_CHANGE_BY_PS)
> >  		ret = true;
> >
> > -	if (hw_queue < BEACON_QUEUE) {
> > -		if (!ret)
> > -			stop_report_cnt++;
> > -		else
> > -			stop_report_cnt = 0;
> > -	}
> > -
> >  	return ret;
> >  }
> >
> > --
> > 2.37.3
> >
> >
> > ------Please consider the environment before printing this e-mail.
Kalle Valo Nov. 1, 2022, 7:36 a.m. UTC | #3
Ping-Ke Shih <pkshih@realtek.com> writes:

>> -----Original Message-----
>> From: Ping-Ke Shih
>> Sent: Tuesday, November 1, 2022 8:22 AM
>> To: 'Colin Ian King' <colin.i.king@gmail.com>; Kalle Valo
>> <kvalo@kernel.org>; David S . Miller
>> <davem@davemloft.net>; Eric Dumazet <edumazet@google.com>; Jakub
>> Kicinski <kuba@kernel.org>; Paolo Abeni
>> <pabeni@redhat.com>; linux-wireless@vger.kernel.org; netdev@vger.kernel.org
>> Cc: kernel-janitors@vger.kernel.org; linux-kernel@vger.kernel.org
>> Subject: RE: [PATCH] rtlwifi: rtl8192ee: remove static variable stop_report_cnt
>> 
>> 
>> > -----Original Message-----
>> > From: Colin Ian King <colin.i.king@gmail.com>
>> > Sent: Monday, October 31, 2022 11:57 PM
>> > To: Ping-Ke Shih <pkshih@realtek.com>; Kalle Valo
>> > <kvalo@kernel.org>; David S . Miller
>> > <davem@davemloft.net>; Eric Dumazet <edumazet@google.com>; Jakub
>> > Kicinski <kuba@kernel.org>; Paolo Abeni
>> > <pabeni@redhat.com>; linux-wireless@vger.kernel.org; netdev@vger.kernel.org
>> > Cc: kernel-janitors@vger.kernel.org; linux-kernel@vger.kernel.org
>> > Subject: [PATCH] rtlwifi: rtl8192ee: remove static variable stop_report_cnt
>
> Subject prefix should be "wifi: rtlwifi: ..."
>
> I'm not sure if Kalle can help this, or you can send v2 to add prefix.

Yeah, I can fix that during commit.
Kalle Valo Nov. 4, 2022, 11 a.m. UTC | #4
Colin Ian King <colin.i.king@gmail.com> wrote:

> Variable stop_report_cnt is being set or incremented but is never
> being used for anything meaningful. The variable and code relating
> to it's use is redundant and can be removed.
> 
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
> Acked-by: Ping-Ke Shih <pkshih@realtek.com>

Patch applied to wireless-next.git, thanks.

cdeee8540952 wifi: rtlwifi: rtl8192ee: remove static variable stop_report_cnt
diff mbox series

Patch

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/trx.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/trx.c
index 8043d819fb85..a182cdeb58e2 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/trx.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/trx.c
@@ -997,7 +997,6 @@  bool rtl92ee_is_tx_desc_closed(struct ieee80211_hw *hw, u8 hw_queue, u16 index)
 	struct rtl_priv *rtlpriv = rtl_priv(hw);
 	u16 read_point, write_point;
 	bool ret = false;
-	static u8 stop_report_cnt;
 	struct rtl8192_tx_ring *ring = &rtlpci->tx_ring[hw_queue];
 
 	{
@@ -1038,13 +1037,6 @@  bool rtl92ee_is_tx_desc_closed(struct ieee80211_hw *hw, u8 hw_queue, u16 index)
 	    rtlpriv->psc.rfoff_reason > RF_CHANGE_BY_PS)
 		ret = true;
 
-	if (hw_queue < BEACON_QUEUE) {
-		if (!ret)
-			stop_report_cnt++;
-		else
-			stop_report_cnt = 0;
-	}
-
 	return ret;
 }