wifi: rtw89: Remove the redundant else branch in the function rtw89_phy_get_kpath
authorJiapeng Chong <jiapeng.chong@linux.alibaba.com>
Mon, 22 Apr 2024 07:29:22 +0000 (15:29 +0800)
committerPing-Ke Shih <pkshih@realtek.com>
Mon, 29 Apr 2024 01:38:22 +0000 (09:38 +0800)
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).

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=8812
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://msgid.link/20240422072922.50940-1-jiapeng.chong@linux.alibaba.com
drivers/net/wireless/realtek/rtw89/phy.c

index eaa18140d1a8325f7b4de83164840590ef1feb24..a82b4c56a6f45a74e59f5a37648b8e2cd4292b6c 100644 (file)
@@ -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: