wifi: rtw89: Remove useless else
PATCH 1/1 wifi: rtw89: Remove useless else
The assignment of the else and if branches is the same, so the else here is redundant, so we remove it.
./drivers/net/wireless/realtek/rtw89/phy.c:6406:2-4: WARNING: possible condition with no effect (if == else).
--- drivers/net/wireless/realtek/rtw89/phy.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/net/wireless/realtek/rtw89/phy.c +1 -4
@@ -6403,10 +6403,7 @@ enum rtw89_rf_path_bit rtw89_phy_get_kpath(struct rtw89_dev *rtwdev,return RF_D ;case MLO_0_PLUS_2_1RF :case MLO_2_PLUS_0_1RF : -if (phy_idx ==RTW89_PHY_0 ) -return RF_AB ; -else -return RF_AB ; +return RF_AB ;case MLO_0_PLUS_2_2RF :case MLO_2_PLUS_0_2RF :case MLO_2_PLUS_2_2RF :
Signature · 1 line
2.20.1.7.g153144c
Ping-Ke Shih
maintainerQuoted 1 line · Jiapeng Chong
Subject: [PATCH] wifi: rtw89: Remove useless else
Please point out the stuff like functions you are changing.
Quoted 19 lines
The assignment of the else and if branches is the same, so the else here is redundant, so we remove it.
./drivers/net/wireless/realtek/rtw89/phy.c:6406:2-4: WARNING: possible condition with no effect (if == else).
Reported-by Abaci Robot <[email protected]>Signed-off-by Jiapeng Chong <[email protected]>--- drivers/net/wireless/realtek/rtw89/phy.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)drivers/net/wireless/realtek/rtw89/phy.c +0
-0
drivers/net/wireless/realtek/rtw89/phy.c enum rtw89_rf_path_bit rtw89_phy_get_kpath(struct rtw89_dev *rtwdev, · line 6406
Quoted 8 lines
drivers/net/wireless/realtek/rtw89/phy.c +1
-4@@ -6403,10 +6403,7 @@ enum rtw89_rf_path_bit rtw89_phy_get_kpath(struct rtw89_dev *rtwdev,return RF_D ;case MLO_0_PLUS_2_1RF :case MLO_2_PLUS_0_1RF : -if (phy_idx ==RTW89_PHY_0 ) -return RF_AB ; -else -return RF_AB ; +return RF_AB ;
The PHY configures to corresponding MLO modes are complicated, so RF people always add branches of phy_idx to prevent missing something, and this is intentionally to say two cases are identical. It is fine to apply your patch, but please add a comment to note that, like
/* for both PHY 0/1 */
Quoted 6 lines
drivers/net/wireless/realtek/rtw89/phy.c +0
-1case MLO_0_PLUS_2_2RF :case MLO_2_PLUS_0_2RF :case MLO_2_PLUS_2_2RF : --2.20.1.7.g153144c