All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] rtlwifi: 8192de: correct checking of IQK reload
@ 2022-05-24  0:37 Ping-Ke Shih
  2022-05-24  1:41 ` Jakub Kicinski
  0 siblings, 1 reply; 3+ messages in thread
From: Ping-Ke Shih @ 2022-05-24  0:37 UTC (permalink / raw)
  To: kvalo, kuba; +Cc: linux-wireless

This mistake is existing since initial commit, and I recall the vendor
driver to find correctness.

Fixes: ee3db469dd31 ("wifi: rtlwifi: remove always-true condition pointed out by GCC 12")
Cc: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
---
This patch should go through net-next tree, because this one is going to fix
"wifi: rtlwifi: remove always-true condition pointed out by GCC 12" that only
exits in that tree.
---
 drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c
index 15e6a6aded319..f6ff32658863d 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c
@@ -2386,7 +2386,10 @@ void rtl92d_phy_reload_iqk_setting(struct ieee80211_hw *hw, u8 channel)
 			rtl_dbg(rtlpriv, COMP_SCAN, DBG_LOUD,
 				"Just Read IQK Matrix reg for channel:%d....\n",
 				channel);
-			_rtl92d_phy_patha_fill_iqk_matrix(hw, true,
+			if ((rtlphy->iqk_matrix[indexforchannel].
+			     value[0][0] != 0)
+				/*&&(regea4 != 0) */)
+				_rtl92d_phy_patha_fill_iqk_matrix(hw, true,
 					rtlphy->iqk_matrix[
 					indexforchannel].value,	0,
 					(rtlphy->iqk_matrix[
-- 
2.25.1


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

* Re: [PATCH net-next] rtlwifi: 8192de: correct checking of IQK reload
  2022-05-24  0:37 [PATCH net-next] rtlwifi: 8192de: correct checking of IQK reload Ping-Ke Shih
@ 2022-05-24  1:41 ` Jakub Kicinski
  2022-05-24  1:57   ` Ping-Ke Shih
  0 siblings, 1 reply; 3+ messages in thread
From: Jakub Kicinski @ 2022-05-24  1:41 UTC (permalink / raw)
  To: Ping-Ke Shih; +Cc: kvalo, linux-wireless

On Tue, 24 May 2022 08:37:50 +0800 Ping-Ke Shih wrote:
> This mistake is existing since initial commit, and I recall the vendor
> driver to find correctness.
> 
> Fixes: ee3db469dd31 ("wifi: rtlwifi: remove always-true condition pointed out by GCC 12")

Not fair, I did not break this code. My change did not alter 
the functionality.

> Cc: Jakub Kicinski <kuba@kernel.org>
> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
> ---
> This patch should go through net-next tree, because this one is going to fix
> "wifi: rtlwifi: remove always-true condition pointed out by GCC 12" that only
> exits in that tree.

If you want it to go via net-next you must CC netdev@.

But I don't see any reason to rush it, AFAICS the code was added in
2011 - commit 7274a8c22980 ("rtlwifi: rtl8192de: Merge phy routines")
or so. We waited 11 years to notice, we can wait a few weeks for the 
patch to propagate thru wireless tree.

> diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c
> index 15e6a6aded319..f6ff32658863d 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c
> @@ -2386,7 +2386,10 @@ void rtl92d_phy_reload_iqk_setting(struct ieee80211_hw *hw, u8 channel)
>  			rtl_dbg(rtlpriv, COMP_SCAN, DBG_LOUD,
>  				"Just Read IQK Matrix reg for channel:%d....\n",
>  				channel);
> -			_rtl92d_phy_patha_fill_iqk_matrix(hw, true,
> +			if ((rtlphy->iqk_matrix[indexforchannel].
> +			     value[0][0] != 0)
> +				/*&&(regea4 != 0) */)

Please don't add the extra brackets around the condition
and the commented out code back in.

> +				_rtl92d_phy_patha_fill_iqk_matrix(hw, true,
>  					rtlphy->iqk_matrix[
>  					indexforchannel].value,	0,
>  					(rtlphy->iqk_matrix[

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

* RE: [PATCH net-next] rtlwifi: 8192de: correct checking of IQK reload
  2022-05-24  1:41 ` Jakub Kicinski
@ 2022-05-24  1:57   ` Ping-Ke Shih
  0 siblings, 0 replies; 3+ messages in thread
From: Ping-Ke Shih @ 2022-05-24  1:57 UTC (permalink / raw)
  To: Jakub Kicinski; +Cc: kvalo, linux-wireless


> -----Original Message-----
> From: Jakub Kicinski <kuba@kernel.org>
> Sent: Tuesday, May 24, 2022 9:41 AM
> To: Ping-Ke Shih <pkshih@realtek.com>
> Cc: kvalo@kernel.org; linux-wireless@vger.kernel.org
> Subject: Re: [PATCH net-next] rtlwifi: 8192de: correct checking of IQK reload
> 
> On Tue, 24 May 2022 08:37:50 +0800 Ping-Ke Shih wrote:
> > This mistake is existing since initial commit, and I recall the vendor
> > driver to find correctness.
> >
> > Fixes: ee3db469dd31 ("wifi: rtlwifi: remove always-true condition pointed out by GCC 12")
> 
> Not fair, I did not break this code. My change did not alter
> the functionality.

Will annotate the commit 11 years ago.

> 
> > Cc: Jakub Kicinski <kuba@kernel.org>
> > Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
> > ---
> > This patch should go through net-next tree, because this one is going to fix
> > "wifi: rtlwifi: remove always-true condition pointed out by GCC 12" that only
> > exits in that tree.
> 
> If you want it to go via net-next you must CC netdev@.
> 
> But I don't see any reason to rush it, AFAICS the code was added in
> 2011 - commit 7274a8c22980 ("rtlwifi: rtl8192de: Merge phy routines")
> or so. We waited 11 years to notice, we can wait a few weeks for the
> patch to propagate thru wireless tree.
> 
> > diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c
> b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c
> > index 15e6a6aded319..f6ff32658863d 100644
> > --- a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c
> > +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c
> > @@ -2386,7 +2386,10 @@ void rtl92d_phy_reload_iqk_setting(struct ieee80211_hw *hw, u8 channel)
> >  			rtl_dbg(rtlpriv, COMP_SCAN, DBG_LOUD,
> >  				"Just Read IQK Matrix reg for channel:%d....\n",
> >  				channel);
> > -			_rtl92d_phy_patha_fill_iqk_matrix(hw, true,
> > +			if ((rtlphy->iqk_matrix[indexforchannel].
> > +			     value[0][0] != 0)
> > +				/*&&(regea4 != 0) */)
> 
> Please don't add the extra brackets around the condition
> and the commented out code back in.

My patch is to revert your patch and correct single one line.
I will correct the strange coding style as well until your patch appears
in wireless-next.

> 
> > +				_rtl92d_phy_patha_fill_iqk_matrix(hw, true,
> >  					rtlphy->iqk_matrix[
> >  					indexforchannel].value,	0,
> >  					(rtlphy->iqk_matrix[
> ------Please consider the environment before printing this e-mail.

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

end of thread, other threads:[~2022-05-24  1:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-24  0:37 [PATCH net-next] rtlwifi: 8192de: correct checking of IQK reload Ping-Ke Shih
2022-05-24  1:41 ` Jakub Kicinski
2022-05-24  1:57   ` Ping-Ke Shih

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.