diff mbox series

AW: [PATCH] rtlwifi: rtl8192ee: remove redundant for-loop

Message ID 73b8d798ffa048418be8443f90a79377@bfs.de (mailing list archive)
State Not Applicable
Delegated to: Kalle Valo
Headers show
Series AW: [PATCH] rtlwifi: rtl8192ee: remove redundant for-loop | expand

Commit Message

Walter Harms May 15, 2020, 12:38 p.m. UTC
if someone has same spare time,
this driver need a bit more love ...

SO far i can see in rtl92ee_phy_iq_calibrate:
* IQK_MATRIX_REG_NUM should be used instead 8 hardcoded.
* the for-loop in the beginning is obfuscating that it sets  simply final_candidate

this can be cleaned:
      reg_e94 = result[final_candidate][0];
      rtlphy->reg_e94 = reg_e94;
      reg_e9c = result[final_candidate][1];
      rtlphy->reg_e9c = reg_e9c;

only reg_e94, reg_ea4 is used later ?

jm2c,
wh
diff mbox series

Patch

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/phy.c
index 6dba576aa81e..bb291b951f4d 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/phy.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/phy.c
@@ -2866,14 +2866,12 @@  void rtl92ee_phy_iq_calibrate(struct ieee80211_hw *hw, bool b_recovery)
                }
        }

-       for (i = 0; i < 4; i++) {
-               reg_e94 = result[i][0];
-               reg_e9c = result[i][1];
-               reg_ea4 = result[i][2];
-               reg_eb4 = result[i][4];
-               reg_ebc = result[i][5];
-               reg_ec4 = result[i][6];
-       }
+       reg_e94 = result[3][0];
+       reg_e9c = result[3][1];
+       reg_ea4 = result[3][2];
+       reg_eb4 = result[3][4];
+       reg_ebc = result[3][5];
+       reg_ec4 = result[3][6];

        if (final_candidate != 0xff) {
                reg_e94 = result[final_candidate][0];