wifi: rtw88: Fix an unreachable code issue
PATCH 1/1 wifi: rtw88: Fix an unreachable code issue
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.
--- drivers/net/wireless/realtek/rtw88/rtw8821a.c | 2 -- 1 file changed, 2 deletions(-)
drivers/net/wireless/realtek/rtw88/rtw8821a.c +0 -2
@@ -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 );
Signature · 1 line
2.34.1
Quoted 14 lines · Dheeraj Reddy Jonnalagadda
The error handling in
rtw8821a_iqk_tx_vdf_true()contained unreachable code due totx_failbeing 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 <[email protected]>--- drivers/net/wireless/realtek/rtw88/rtw8821a.c | 2 -- 1 file changed, 2 deletions(-)drivers/net/wireless/realtek/rtw88/rtw8821a.c +0
-0
drivers/net/wireless/realtek/rtw88/rtw8821a.c static void rtw8821a_iqk_tx_vdf_true(struct rtw_dev *rtwdev, u32 cal, · line 226
Quoted 8 lines
drivers/net/wireless/realtek/rtw88/rtw8821a.c +0
-2@@ -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.