]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
rtlwifi: Simplify chip version id logging
authorJoe Perches <joe@perches.com>
Fri, 6 Jan 2012 19:31:43 +0000 (11:31 -0800)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 24 Jan 2012 19:08:34 +0000 (14:08 -0500)
Reduce object size a few KB too.

$ size drivers/net/wireless/rtlwifi/built-in.o*
   text    data     bss     dec     hex filename
 584493   55333  126800  766626   bb2a2 drivers/net/wireless/rtlwifi/built-in.o.new
 586904   55333  127216  769453   bbdad drivers/net/wireless/rtlwifi/built-in.o.old

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/rtlwifi/rtl8192ce/hw.c
drivers/net/wireless/rtlwifi/rtl8192cu/mac.c

index 18f615c41212a34a3475892cb0e91aeab927399b..971bd29ef9bc8ea138bb53be4746b1a80d8de626 100644 (file)
@@ -991,6 +991,7 @@ static enum version_8192c _rtl92ce_read_chip_version(struct ieee80211_hw *hw)
        struct rtl_phy *rtlphy = &(rtlpriv->phy);
        enum version_8192c version = VERSION_UNKNOWN;
        u32 value32;
+       const char *versionid;
 
        value32 = rtl_read_dword(rtlpriv, REG_SYS_CFG);
        if (value32 & TRP_VAUX_EN) {
@@ -1003,27 +1004,25 @@ static enum version_8192c _rtl92ce_read_chip_version(struct ieee80211_hw *hw)
 
        switch (version) {
        case VERSION_B_CHIP_92C:
-               RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
-                        "Chip Version ID: VERSION_B_CHIP_92C\n");
+               versionid = "B_CHIP_92C";
                break;
        case VERSION_B_CHIP_88C:
-               RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
-                        "Chip Version ID: VERSION_B_CHIP_88C\n");
+               versionid = "B_CHIP_88C";
                break;
        case VERSION_A_CHIP_92C:
-               RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
-                        "Chip Version ID: VERSION_A_CHIP_92C\n");
+               versionid = "A_CHIP_92C";
                break;
        case VERSION_A_CHIP_88C:
-               RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
-                        "Chip Version ID: VERSION_A_CHIP_88C\n");
+               versionid = "A_CHIP_88C";
                break;
        default:
-               RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-                        "Chip Version ID: Unknown. Bug?\n");
+               versionid = "Unknown. Bug?";
                break;
        }
 
+       RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
+                "Chip Version ID: %s\n", versionid);
+
        switch (version & 0x3) {
        case CHIP_88C:
                rtlphy->rf_type = RF_1T1R;
index 71c7aca0b43194e1ef45e49e3742877f08d9f9b3..060ed5fec690f462e5dbbe6f8a06951b5b1a4e9c 100644 (file)
@@ -57,6 +57,7 @@ void rtl92c_read_chip_version(struct ieee80211_hw *hw)
        struct rtl_phy *rtlphy = &(rtlpriv->phy);
        struct rtl_hal *rtlhal = rtl_hal(rtlpriv);
        enum version_8192c chip_version = VERSION_UNKNOWN;
+       const char *versionid;
        u32 value32;
 
        value32 = rtl_read_dword(rtlpriv, REG_SYS_CFG);
@@ -87,62 +88,51 @@ void rtl92c_read_chip_version(struct ieee80211_hw *hw)
        pr_info("Chip version 0x%x\n", chip_version);
        switch (rtlhal->version) {
        case VERSION_NORMAL_TSMC_CHIP_92C_1T2R:
-               RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
-                        "Chip Version ID: VERSION_B_CHIP_92C\n");
+               versionid = "NORMAL_B_CHIP_92C";
                break;
        case VERSION_NORMAL_TSMC_CHIP_92C:
-               RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
-                        "Chip Version ID: VERSION_NORMAL_TSMC_CHIP_92C\n");
+               versionid = "NORMAL_TSMC_CHIP_92C";
                break;
        case VERSION_NORMAL_TSMC_CHIP_88C:
-               RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
-                        "Chip Version ID: VERSION_NORMAL_TSMC_CHIP_88C\n");
+               versionid = "NORMAL_TSMC_CHIP_88C";
                break;
        case VERSION_NORMAL_UMC_CHIP_92C_1T2R_A_CUT:
-               RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
-                        "Chip Version ID: VERSION_NORMAL_UMC_CHIP_i92C_1T2R_A_CUT\n");
+               versionid = "NORMAL_UMC_CHIP_i92C_1T2R_A_CUT";
                break;
        case VERSION_NORMAL_UMC_CHIP_92C_A_CUT:
-               RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
-                        "Chip Version ID: VERSION_NORMAL_UMC_CHIP_92C_A_CUT\n");
+               versionid = "NORMAL_UMC_CHIP_92C_A_CUT";
                break;
        case VERSION_NORMAL_UMC_CHIP_88C_A_CUT:
-               RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
-                        "Chip Version ID: VERSION_NORMAL_UMC_CHIP_88C_A_CUT\n");
+               versionid = "NORMAL_UMC_CHIP_88C_A_CUT";
                break;
        case VERSION_NORMAL_UMC_CHIP_92C_1T2R_B_CUT:
-               RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
-                        "Chip Version ID: VERSION_NORMAL_UMC_CHIP_92C_1T2R_B_CUT\n");
+               versionid = "NORMAL_UMC_CHIP_92C_1T2R_B_CUT";
                break;
        case VERSION_NORMAL_UMC_CHIP_92C_B_CUT:
-               RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
-                        "Chip Version ID: VERSION_NORMAL_UMC_CHIP_92C_B_CUT\n");
+               versionid = "NORMAL_UMC_CHIP_92C_B_CUT";
                break;
        case VERSION_NORMAL_UMC_CHIP_88C_B_CUT:
-               RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
-                        "Chip Version ID: VERSION_NORMAL_UMC_CHIP_88C_B_CUT\n");
+               versionid = "NORMAL_UMC_CHIP_88C_B_CUT";
                break;
        case VERSION_NORMA_UMC_CHIP_8723_1T1R_A_CUT:
-               RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
-                        "Chip Version ID: VERSION_NORMA_UMC_CHIP_8723_1T1R_A_CUT\n");
+               versionid = "NORMAL_UMC_CHIP_8723_1T1R_A_CUT";
                break;
        case VERSION_NORMA_UMC_CHIP_8723_1T1R_B_CUT:
-               RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
-                        "Chip Version ID: VERSION_NORMA_UMC_CHIP_8723_1T1R_B_CUT\n");
+               versionid = "NORMAL_UMC_CHIP_8723_1T1R_B_CUT";
                break;
        case VERSION_TEST_CHIP_92C:
-               RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
-                        "Chip Version ID: VERSION_TEST_CHIP_92C\n");
+               versionid = "TEST_CHIP_92C";
                break;
        case VERSION_TEST_CHIP_88C:
-               RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
-                        "Chip Version ID: VERSION_TEST_CHIP_88C\n");
+               versionid = "TEST_CHIP_88C";
                break;
        default:
-               RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
-                        "Chip Version ID: ???????????????\n");
+               versionid = "UNKNOWN";
                break;
        }
+       RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
+                "Chip Version ID: %s\n", versionid);
+
        if (IS_92C_SERIAL(rtlhal->version))
                rtlphy->rf_type =
                         (IS_92C_1T2R(rtlhal->version)) ? RF_1T2R : RF_2T2R;