rtlwifi: Convert RTPRINT macro to use ##__VA_ARGS__
Consolidate printks to avoid possible message interleaving and reduce the object size. Remove unnecessary RTPRINT parentheses. Coalesce formats. Align arguments. $ size drivers/net/wireless/rtlwifi/built-in.o* text data bss dec hex filename 590002 55333 127560 772895 bcb1f drivers/net/wireless/rtlwifi/built-in.o.new 594841 55333 129680 779854 be64e 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>
This commit is contained in:

committed by
John W. Linville

parent
f30d7507a8
commit
4c48869f5d
@@ -140,26 +140,26 @@ void rtl92cu_phy_rf6052_set_cck_txpower(struct ieee80211_hw *hw,
|
||||
rtl_set_bbreg(hw, RTXAGC_A_CCK1_MCS32, MASKBYTE1, tmpval);
|
||||
|
||||
RTPRINT(rtlpriv, FPHY, PHY_TXPWR,
|
||||
("CCK PWR 1M (rf-A) = 0x%x (reg 0x%x)\n", tmpval,
|
||||
RTXAGC_A_CCK1_MCS32));
|
||||
"CCK PWR 1M (rf-A) = 0x%x (reg 0x%x)\n",
|
||||
tmpval, RTXAGC_A_CCK1_MCS32);
|
||||
|
||||
tmpval = tx_agc[RF90_PATH_A] >> 8;
|
||||
if (mac->mode == WIRELESS_MODE_B)
|
||||
tmpval = tmpval & 0xff00ffff;
|
||||
rtl_set_bbreg(hw, RTXAGC_B_CCK11_A_CCK2_11, 0xffffff00, tmpval);
|
||||
RTPRINT(rtlpriv, FPHY, PHY_TXPWR,
|
||||
("CCK PWR 2~11M (rf-A) = 0x%x (reg 0x%x)\n", tmpval,
|
||||
RTXAGC_B_CCK11_A_CCK2_11));
|
||||
"CCK PWR 2~11M (rf-A) = 0x%x (reg 0x%x)\n",
|
||||
tmpval, RTXAGC_B_CCK11_A_CCK2_11);
|
||||
tmpval = tx_agc[RF90_PATH_B] >> 24;
|
||||
rtl_set_bbreg(hw, RTXAGC_B_CCK11_A_CCK2_11, MASKBYTE0, tmpval);
|
||||
RTPRINT(rtlpriv, FPHY, PHY_TXPWR,
|
||||
("CCK PWR 11M (rf-B) = 0x%x (reg 0x%x)\n", tmpval,
|
||||
RTXAGC_B_CCK11_A_CCK2_11));
|
||||
"CCK PWR 11M (rf-B) = 0x%x (reg 0x%x)\n",
|
||||
tmpval, RTXAGC_B_CCK11_A_CCK2_11);
|
||||
tmpval = tx_agc[RF90_PATH_B] & 0x00ffffff;
|
||||
rtl_set_bbreg(hw, RTXAGC_B_CCK1_55_MCS32, 0xffffff00, tmpval);
|
||||
RTPRINT(rtlpriv, FPHY, PHY_TXPWR,
|
||||
("CCK PWR 1~5.5M (rf-B) = 0x%x (reg 0x%x)\n", tmpval,
|
||||
RTXAGC_B_CCK1_55_MCS32));
|
||||
"CCK PWR 1~5.5M (rf-B) = 0x%x (reg 0x%x)\n",
|
||||
tmpval, RTXAGC_B_CCK1_55_MCS32);
|
||||
}
|
||||
|
||||
static void rtl92c_phy_get_power_base(struct ieee80211_hw *hw,
|
||||
@@ -181,8 +181,8 @@ static void rtl92c_phy_get_power_base(struct ieee80211_hw *hw,
|
||||
(powerBase0 << 8) | powerBase0;
|
||||
*(ofdmbase + i) = powerBase0;
|
||||
RTPRINT(rtlpriv, FPHY, PHY_TXPWR,
|
||||
(" [OFDM power base index rf(%c) = 0x%x]\n",
|
||||
((i == 0) ? 'A' : 'B'), *(ofdmbase + i)));
|
||||
" [OFDM power base index rf(%c) = 0x%x]\n",
|
||||
i == 0 ? 'A' : 'B', *(ofdmbase + i));
|
||||
}
|
||||
for (i = 0; i < 2; i++) {
|
||||
if (rtlphy->current_chan_bw == HT_CHANNEL_WIDTH_20) {
|
||||
@@ -194,8 +194,8 @@ static void rtl92c_phy_get_power_base(struct ieee80211_hw *hw,
|
||||
(powerBase1 << 16) | (powerBase1 << 8) | powerBase1;
|
||||
*(mcsbase + i) = powerBase1;
|
||||
RTPRINT(rtlpriv, FPHY, PHY_TXPWR,
|
||||
(" [MCS power base index rf(%c) = 0x%x]\n",
|
||||
((i == 0) ? 'A' : 'B'), *(mcsbase + i)));
|
||||
" [MCS power base index rf(%c) = 0x%x]\n",
|
||||
i == 0 ? 'A' : 'B', *(mcsbase + i));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -219,8 +219,8 @@ static void _rtl92c_get_txpower_writeval_by_regulatory(struct ieee80211_hw *hw,
|
||||
[chnlgroup][index + (rf ? 8 : 0)]
|
||||
+ ((index < 2) ? powerBase0[rf] : powerBase1[rf]);
|
||||
RTPRINT(rtlpriv, FPHY, PHY_TXPWR,
|
||||
("RTK better performance,writeVal(%c) = 0x%x\n",
|
||||
((rf == 0) ? 'A' : 'B'), writeVal));
|
||||
"RTK better performance,writeVal(%c) = 0x%x\n",
|
||||
rf == 0 ? 'A' : 'B', writeVal);
|
||||
break;
|
||||
case 1:
|
||||
if (rtlphy->pwrgroup_cnt == 1)
|
||||
@@ -244,32 +244,31 @@ static void _rtl92c_get_txpower_writeval_by_regulatory(struct ieee80211_hw *hw,
|
||||
((index < 2) ? powerBase0[rf] :
|
||||
powerBase1[rf]);
|
||||
RTPRINT(rtlpriv, FPHY, PHY_TXPWR,
|
||||
("Realtek regulatory, 20MHz, "
|
||||
"writeVal(%c) = 0x%x\n",
|
||||
((rf == 0) ? 'A' : 'B'), writeVal));
|
||||
"Realtek regulatory, 20MHz, writeVal(%c) = 0x%x\n",
|
||||
rf == 0 ? 'A' : 'B', writeVal);
|
||||
break;
|
||||
case 2:
|
||||
writeVal = ((index < 2) ? powerBase0[rf] :
|
||||
powerBase1[rf]);
|
||||
RTPRINT(rtlpriv, FPHY, PHY_TXPWR,
|
||||
("Better regulatory,writeVal(%c) = 0x%x\n",
|
||||
((rf == 0) ? 'A' : 'B'), writeVal));
|
||||
"Better regulatory,writeVal(%c) = 0x%x\n",
|
||||
rf == 0 ? 'A' : 'B', writeVal);
|
||||
break;
|
||||
case 3:
|
||||
chnlgroup = 0;
|
||||
if (rtlphy->current_chan_bw ==
|
||||
HT_CHANNEL_WIDTH_20_40) {
|
||||
RTPRINT(rtlpriv, FPHY, PHY_TXPWR,
|
||||
("customer's limit, 40MHzrf(%c) = "
|
||||
"0x%x\n", ((rf == 0) ? 'A' : 'B'),
|
||||
"customer's limit, 40MHzrf(%c) = 0x%x\n",
|
||||
rf == 0 ? 'A' : 'B',
|
||||
rtlefuse->pwrgroup_ht40[rf]
|
||||
[channel - 1]));
|
||||
[channel - 1]);
|
||||
} else {
|
||||
RTPRINT(rtlpriv, FPHY, PHY_TXPWR,
|
||||
("customer's limit, 20MHz rf(%c) = "
|
||||
"0x%x\n", ((rf == 0) ? 'A' : 'B'),
|
||||
"customer's limit, 20MHz rf(%c) = 0x%x\n",
|
||||
rf == 0 ? 'A' : 'B',
|
||||
rtlefuse->pwrgroup_ht20[rf]
|
||||
[channel - 1]));
|
||||
[channel - 1]);
|
||||
}
|
||||
for (i = 0; i < 4; i++) {
|
||||
pwr_diff_limit[i] =
|
||||
@@ -297,22 +296,22 @@ static void _rtl92c_get_txpower_writeval_by_regulatory(struct ieee80211_hw *hw,
|
||||
(pwr_diff_limit[2] << 16) |
|
||||
(pwr_diff_limit[1] << 8) | (pwr_diff_limit[0]);
|
||||
RTPRINT(rtlpriv, FPHY, PHY_TXPWR,
|
||||
("Customer's limit rf(%c) = 0x%x\n",
|
||||
((rf == 0) ? 'A' : 'B'), customer_limit));
|
||||
"Customer's limit rf(%c) = 0x%x\n",
|
||||
rf == 0 ? 'A' : 'B', customer_limit);
|
||||
writeVal = customer_limit + ((index < 2) ?
|
||||
powerBase0[rf] : powerBase1[rf]);
|
||||
RTPRINT(rtlpriv, FPHY, PHY_TXPWR,
|
||||
("Customer, writeVal rf(%c)= 0x%x\n",
|
||||
((rf == 0) ? 'A' : 'B'), writeVal));
|
||||
"Customer, writeVal rf(%c)= 0x%x\n",
|
||||
rf == 0 ? 'A' : 'B', writeVal);
|
||||
break;
|
||||
default:
|
||||
chnlgroup = 0;
|
||||
writeVal = rtlphy->mcs_txpwrlevel_origoffset[chnlgroup]
|
||||
[index + (rf ? 8 : 0)] + ((index < 2) ?
|
||||
powerBase0[rf] : powerBase1[rf]);
|
||||
RTPRINT(rtlpriv, FPHY, PHY_TXPWR, ("RTK better "
|
||||
"performance, writeValrf(%c) = 0x%x\n",
|
||||
((rf == 0) ? 'A' : 'B'), writeVal));
|
||||
RTPRINT(rtlpriv, FPHY, PHY_TXPWR,
|
||||
"RTK better performance, writeValrf(%c) = 0x%x\n",
|
||||
rf == 0 ? 'A' : 'B', writeVal);
|
||||
break;
|
||||
}
|
||||
if (rtlpriv->dm.dynamic_txhighpower_lvl ==
|
||||
@@ -365,7 +364,7 @@ static void _rtl92c_write_ofdm_power_reg(struct ieee80211_hw *hw,
|
||||
regoffset = regoffset_b[index];
|
||||
rtl_set_bbreg(hw, regoffset, MASKDWORD, writeVal);
|
||||
RTPRINT(rtlpriv, FPHY, PHY_TXPWR,
|
||||
("Set 0x%x = %08x\n", regoffset, writeVal));
|
||||
"Set 0x%x = %08x\n", regoffset, writeVal);
|
||||
if (((get_rf_type(rtlphy) == RF_2T2R) &&
|
||||
(regoffset == RTXAGC_A_MCS15_MCS12 ||
|
||||
regoffset == RTXAGC_B_MCS15_MCS12)) ||
|
||||
|
Reference in New Issue
Block a user