public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH wireless-next] wifi: rtw88: Fix an unreachable code issue
@ 2024-11-22 12:14 Dheeraj Reddy Jonnalagadda
  2024-11-22 19:10 ` Bitterblue Smith
  0 siblings, 1 reply; 2+ messages in thread
From: Dheeraj Reddy Jonnalagadda @ 2024-11-22 12:14 UTC (permalink / raw)
  To: pkshih, linux-wireless; +Cc: kvalo, linux-kernel, Dheeraj Reddy Jonnalagadda

The error handling in rtw8821a_iqk_tx_vdf_true() contained unreachable
code due to tx_fail being explicitly set to false before the error check.
This prevented proper handling of failures and resulted in dead code.

Signed-off-by: Dheeraj Reddy Jonnalagadda <dheeraj.linuxdev@gmail.com>
---
 drivers/net/wireless/realtek/rtw88/rtw8821a.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtw88/rtw8821a.c b/drivers/net/wireless/realtek/rtw88/rtw8821a.c
index db242c9ad68f..c06ba7d615df 100644
--- a/drivers/net/wireless/realtek/rtw88/rtw8821a.c
+++ b/drivers/net/wireless/realtek/rtw88/rtw8821a.c
@@ -221,8 +221,6 @@ static void rtw8821a_iqk_tx_vdf_true(struct rtw_dev *rtwdev, u32 cal,
 				/* Originally: if (~tx_fail) {
 				 * It looks like a typo, so make it more explicit.
 				 */
-				tx_fail = false;
-
 				if (!tx_fail) {
 					rtw_write32(rtwdev, REG_RFECTL_A,
 						    0x02000000);
-- 
2.34.1


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

* Re: [PATCH wireless-next] wifi: rtw88: Fix an unreachable code issue
  2024-11-22 12:14 [PATCH wireless-next] wifi: rtw88: Fix an unreachable code issue Dheeraj Reddy Jonnalagadda
@ 2024-11-22 19:10 ` Bitterblue Smith
  0 siblings, 0 replies; 2+ messages in thread
From: Bitterblue Smith @ 2024-11-22 19:10 UTC (permalink / raw)
  To: Dheeraj Reddy Jonnalagadda, pkshih, linux-wireless; +Cc: kvalo, linux-kernel

On 22/11/2024 14:14, Dheeraj Reddy Jonnalagadda wrote:
> The error handling in rtw8821a_iqk_tx_vdf_true() contained unreachable
> code due to tx_fail being explicitly set to false before the error check.
> This prevented proper handling of failures and resulted in dead code.
> 
> Signed-off-by: Dheeraj Reddy Jonnalagadda <dheeraj.linuxdev@gmail.com>
> ---
>  drivers/net/wireless/realtek/rtw88/rtw8821a.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/net/wireless/realtek/rtw88/rtw8821a.c b/drivers/net/wireless/realtek/rtw88/rtw8821a.c
> index db242c9ad68f..c06ba7d615df 100644
> --- a/drivers/net/wireless/realtek/rtw88/rtw8821a.c
> +++ b/drivers/net/wireless/realtek/rtw88/rtw8821a.c
> @@ -221,8 +221,6 @@ static void rtw8821a_iqk_tx_vdf_true(struct rtw_dev *rtwdev, u32 cal,
>  				/* Originally: if (~tx_fail) {
>  				 * It looks like a typo, so make it more explicit.
>  				 */
> -				tx_fail = false;
> -
>  				if (!tx_fail) {
>  					rtw_write32(rtwdev, REG_RFECTL_A,
>  						    0x02000000);

It's like that on purpose, as you can see from the comment.

Your patch changes the behaviour of the code. If it really bothers you,
fix it without changing the behaviour.

Also, you should mention in the commit message if you tested
with real hardware or not, and what tool brought this problem
to your attention.

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

end of thread, other threads:[~2024-11-22 19:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-22 12:14 [PATCH wireless-next] wifi: rtw88: Fix an unreachable code issue Dheeraj Reddy Jonnalagadda
2024-11-22 19:10 ` Bitterblue Smith

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox