wifi: rtw89: Remove the redundant else branch in the function rtw89_phy_get_kpath
PATCH v2 1/1 wifi: rtw89: Remove the redundant else branch in the function rtw89_phy_get_kpath
The assignment of the else and if branches is the same in the "case:MLO_2_PLUS_0_1RF" branch of the function rtw89_phy_get_kpath, so we remove it and add comments here to make the code easier to understand.
./drivers/net/wireless/realtek/rtw89/phy.c:6406:2-4: WARNING: possible condition with no effect (if == else).
---
Changes in v2:
-Add code comments, modify commit subject, and content description.
drivers/net/wireless/realtek/rtw89/phy.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/wireless/realtek/rtw89/phy.c +2 -4
@@ -6403,10 +6403,8 @@ 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 ; +/* for both PHY 0/1 */ +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 9 lines · Jiapeng Chong
The assignment of the else and if branches is the same in the "case:
MLO_2_PLUS_0_1RF" branch of the functionrtw89_phy_get_kpath, so we remove it and add comments here to make the code easier to understand../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]>
1 patch(es) applied to rtw-next branch of rtw.git, thanks.
5eb027019fa3 wifi: rtw89: Remove the redundant else branch in the function rtw89_phy_get_kpath