Skip to content

Commit d2182b6

Browse files
JoePercheslinvjw
authored andcommitted
ath: Convert ath_dbg(bar, ATH_DBG_<FOO>, to ath_dbg(bar, FOO
Add ATH_DBG_ to macros to shorten the uses and reduce the line count. Coalesce ath_dbg formats. Add missing spaces to coalesced formats. Add missing newline terminations to ath_dbg formats. Align ath_dbg arguments where appropriate. Standardize ath_dbg formats without periods. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
1 parent a85e1d5 commit d2182b6

34 files changed

Lines changed: 647 additions & 799 deletions

‎drivers/net/wireless/ath/ath.h‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ enum ATH_DEBUG {
255255

256256
#define ath_dbg(common, dbg_mask, fmt, ...) \
257257
do { \
258-
if ((common)->debug_mask & dbg_mask) \
258+
if ((common)->debug_mask & ATH_DBG_##dbg_mask) \
259259
_ath_printk(KERN_DEBUG, common, fmt, ##__VA_ARGS__); \
260260
} while (0)
261261

@@ -265,10 +265,13 @@ do { \
265265
#else
266266

267267
static inline __attribute__ ((format (printf, 3, 4)))
268-
void ath_dbg(struct ath_common *common, enum ATH_DEBUG dbg_mask,
268+
void _ath_dbg(struct ath_common *common, enum ATH_DEBUG dbg_mask,
269269
const char *fmt, ...)
270270
{
271271
}
272+
#define ath_dbg(common, dbg_mask, fmt, ...) \
273+
_ath_dbg(common, ATH_DBG_##dbg_mask, fmt, ##__VA_ARGS__)
274+
272275
#define ATH_DBG_WARN(foo, arg...) do {} while (0)
273276
#define ATH_DBG_WARN_ON_ONCE(foo) ({ \
274277
int __ret_warn_once = !!(foo); \

‎drivers/net/wireless/ath/ath9k/ani.c‎

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,8 @@ static void ath9k_ani_restart(struct ath_hw *ah)
136136
cck_base = AR_PHY_COUNTMAX - ah->config.cck_trig_high;
137137
}
138138

139-
ath_dbg(common, ATH_DBG_ANI,
140-
"Writing ofdmbase=%u cckbase=%u\n", ofdm_base, cck_base);
139+
ath_dbg(common, ANI, "Writing ofdmbase=%u cckbase=%u\n",
140+
ofdm_base, cck_base);
141141

142142
ENABLE_REGWRITE_BUFFER(ah);
143143

@@ -268,8 +268,7 @@ static void ath9k_hw_set_ofdm_nil(struct ath_hw *ah, u8 immunityLevel)
268268

269269
aniState->noiseFloor = BEACON_RSSI(ah);
270270

271-
ath_dbg(common, ATH_DBG_ANI,
272-
"**** ofdmlevel %d=>%d, rssi=%d[lo=%d hi=%d]\n",
271+
ath_dbg(common, ANI, "**** ofdmlevel %d=>%d, rssi=%d[lo=%d hi=%d]\n",
273272
aniState->ofdmNoiseImmunityLevel,
274273
immunityLevel, aniState->noiseFloor,
275274
aniState->rssiThrLow, aniState->rssiThrHigh);
@@ -336,8 +335,7 @@ static void ath9k_hw_set_cck_nil(struct ath_hw *ah, u_int8_t immunityLevel)
336335
const struct ani_cck_level_entry *entry_cck;
337336

338337
aniState->noiseFloor = BEACON_RSSI(ah);
339-
ath_dbg(common, ATH_DBG_ANI,
340-
"**** ccklevel %d=>%d, rssi=%d[lo=%d hi=%d]\n",
338+
ath_dbg(common, ANI, "**** ccklevel %d=>%d, rssi=%d[lo=%d hi=%d]\n",
341339
aniState->cckNoiseImmunityLevel, immunityLevel,
342340
aniState->noiseFloor, aniState->rssiThrLow,
343341
aniState->rssiThrHigh);
@@ -481,8 +479,7 @@ static void ath9k_ani_reset_old(struct ath_hw *ah, bool is_scanning)
481479

482480
if (ah->opmode != NL80211_IFTYPE_STATION
483481
&& ah->opmode != NL80211_IFTYPE_ADHOC) {
484-
ath_dbg(common, ATH_DBG_ANI,
485-
"Reset ANI state opmode %u\n", ah->opmode);
482+
ath_dbg(common, ANI, "Reset ANI state opmode %u\n", ah->opmode);
486483
ah->stats.ast_ani_reset++;
487484

488485
if (ah->opmode == NL80211_IFTYPE_AP) {
@@ -582,7 +579,7 @@ void ath9k_ani_reset(struct ath_hw *ah, bool is_scanning)
582579
ATH9K_ANI_OFDM_DEF_LEVEL ||
583580
aniState->cckNoiseImmunityLevel !=
584581
ATH9K_ANI_CCK_DEF_LEVEL) {
585-
ath_dbg(common, ATH_DBG_ANI,
582+
ath_dbg(common, ANI,
586583
"Restore defaults: opmode %u chan %d Mhz/0x%x is_scanning=%d ofdm:%d cck:%d\n",
587584
ah->opmode,
588585
chan->channel,
@@ -599,7 +596,7 @@ void ath9k_ani_reset(struct ath_hw *ah, bool is_scanning)
599596
/*
600597
* restore historical levels for this channel
601598
*/
602-
ath_dbg(common, ATH_DBG_ANI,
599+
ath_dbg(common, ANI,
603600
"Restore history: opmode %u chan %d Mhz/0x%x is_scanning=%d ofdm:%d cck:%d\n",
604601
ah->opmode,
605602
chan->channel,
@@ -662,15 +659,15 @@ static bool ath9k_hw_ani_read_counters(struct ath_hw *ah)
662659

663660
if (!use_new_ani(ah) && (phyCnt1 < ofdm_base || phyCnt2 < cck_base)) {
664661
if (phyCnt1 < ofdm_base) {
665-
ath_dbg(common, ATH_DBG_ANI,
662+
ath_dbg(common, ANI,
666663
"phyCnt1 0x%x, resetting counter value to 0x%x\n",
667664
phyCnt1, ofdm_base);
668665
REG_WRITE(ah, AR_PHY_ERR_1, ofdm_base);
669666
REG_WRITE(ah, AR_PHY_ERR_MASK_1,
670667
AR_PHY_ERR_OFDM_TIMING);
671668
}
672669
if (phyCnt2 < cck_base) {
673-
ath_dbg(common, ATH_DBG_ANI,
670+
ath_dbg(common, ANI,
674671
"phyCnt2 0x%x, resetting counter value to 0x%x\n",
675672
phyCnt2, cck_base);
676673
REG_WRITE(ah, AR_PHY_ERR_2, cck_base);
@@ -713,7 +710,7 @@ void ath9k_hw_ani_monitor(struct ath_hw *ah, struct ath9k_channel *chan)
713710
cckPhyErrRate = aniState->cckPhyErrCount * 1000 /
714711
aniState->listenTime;
715712

716-
ath_dbg(common, ATH_DBG_ANI,
713+
ath_dbg(common, ANI,
717714
"listenTime=%d OFDM:%d errs=%d/s CCK:%d errs=%d/s ofdm_turn=%d\n",
718715
aniState->listenTime,
719716
aniState->ofdmNoiseImmunityLevel,
@@ -748,7 +745,7 @@ void ath9k_enable_mib_counters(struct ath_hw *ah)
748745
{
749746
struct ath_common *common = ath9k_hw_common(ah);
750747

751-
ath_dbg(common, ATH_DBG_ANI, "Enable MIB counters\n");
748+
ath_dbg(common, ANI, "Enable MIB counters\n");
752749

753750
ath9k_hw_update_mibstats(ah, &ah->ah_mibStats);
754751

@@ -770,7 +767,7 @@ void ath9k_hw_disable_mib_counters(struct ath_hw *ah)
770767
{
771768
struct ath_common *common = ath9k_hw_common(ah);
772769

773-
ath_dbg(common, ATH_DBG_ANI, "Disable MIB counters\n");
770+
ath_dbg(common, ANI, "Disable MIB counters\n");
774771

775772
REG_WRITE(ah, AR_MIBC, AR_MIBC_FMC);
776773
ath9k_hw_update_mibstats(ah, &ah->ah_mibStats);
@@ -845,7 +842,7 @@ void ath9k_hw_ani_init(struct ath_hw *ah)
845842
struct ath_common *common = ath9k_hw_common(ah);
846843
int i;
847844

848-
ath_dbg(common, ATH_DBG_ANI, "Initialize ANI\n");
845+
ath_dbg(common, ANI, "Initialize ANI\n");
849846

850847
if (use_new_ani(ah)) {
851848
ah->config.ofdm_trig_high = ATH9K_ANI_OFDM_TRIG_HIGH_NEW;

‎drivers/net/wireless/ath/ath9k/ar5008_phy.c‎

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ static void ar5008_hw_force_bias(struct ath_hw *ah, u16 synth_freq)
158158
/* pre-reverse this field */
159159
tmp_reg = ath9k_hw_reverse_bits(new_bias, 3);
160160

161-
ath_dbg(common, ATH_DBG_CONFIG, "Force rf_pwd_icsyndiv to %1d on %4d\n",
161+
ath_dbg(common, CONFIG, "Force rf_pwd_icsyndiv to %1d on %4d\n",
162162
new_bias, synth_freq);
163163

164164
/* swizzle rf_pwd_icsyndiv */
@@ -1053,8 +1053,7 @@ static bool ar5008_hw_ani_control_old(struct ath_hw *ah,
10531053
u32 level = param;
10541054

10551055
if (level >= ARRAY_SIZE(ah->totalSizeDesired)) {
1056-
ath_dbg(common, ATH_DBG_ANI,
1057-
"level out of range (%u > %zu)\n",
1056+
ath_dbg(common, ANI, "level out of range (%u > %zu)\n",
10581057
level, ARRAY_SIZE(ah->totalSizeDesired));
10591058
return false;
10601059
}
@@ -1157,8 +1156,7 @@ static bool ar5008_hw_ani_control_old(struct ath_hw *ah,
11571156
u32 level = param;
11581157

11591158
if (level >= ARRAY_SIZE(firstep)) {
1160-
ath_dbg(common, ATH_DBG_ANI,
1161-
"level out of range (%u > %zu)\n",
1159+
ath_dbg(common, ANI, "level out of range (%u > %zu)\n",
11621160
level, ARRAY_SIZE(firstep));
11631161
return false;
11641162
}
@@ -1177,8 +1175,7 @@ static bool ar5008_hw_ani_control_old(struct ath_hw *ah,
11771175
u32 level = param;
11781176

11791177
if (level >= ARRAY_SIZE(cycpwrThr1)) {
1180-
ath_dbg(common, ATH_DBG_ANI,
1181-
"level out of range (%u > %zu)\n",
1178+
ath_dbg(common, ANI, "level out of range (%u > %zu)\n",
11821179
level, ARRAY_SIZE(cycpwrThr1));
11831180
return false;
11841181
}
@@ -1195,23 +1192,22 @@ static bool ar5008_hw_ani_control_old(struct ath_hw *ah,
11951192
case ATH9K_ANI_PRESENT:
11961193
break;
11971194
default:
1198-
ath_dbg(common, ATH_DBG_ANI, "invalid cmd %u\n", cmd);
1195+
ath_dbg(common, ANI, "invalid cmd %u\n", cmd);
11991196
return false;
12001197
}
12011198

1202-
ath_dbg(common, ATH_DBG_ANI, "ANI parameters:\n");
1203-
ath_dbg(common, ATH_DBG_ANI,
1199+
ath_dbg(common, ANI, "ANI parameters:\n");
1200+
ath_dbg(common, ANI,
12041201
"noiseImmunityLevel=%d, spurImmunityLevel=%d, ofdmWeakSigDetectOff=%d\n",
12051202
aniState->noiseImmunityLevel,
12061203
aniState->spurImmunityLevel,
12071204
!aniState->ofdmWeakSigDetectOff);
1208-
ath_dbg(common, ATH_DBG_ANI,
1205+
ath_dbg(common, ANI,
12091206
"cckWeakSigThreshold=%d, firstepLevel=%d, listenTime=%d\n",
12101207
aniState->cckWeakSigThreshold,
12111208
aniState->firstepLevel,
12121209
aniState->listenTime);
1213-
ath_dbg(common, ATH_DBG_ANI,
1214-
"ofdmPhyErrCount=%d, cckPhyErrCount=%d\n\n",
1210+
ath_dbg(common, ANI, "ofdmPhyErrCount=%d, cckPhyErrCount=%d\n\n",
12151211
aniState->ofdmPhyErrCount,
12161212
aniState->cckPhyErrCount);
12171213

@@ -1295,7 +1291,7 @@ static bool ar5008_hw_ani_control_new(struct ath_hw *ah,
12951291
AR_PHY_SFCORR_LOW_USE_SELF_CORR_LOW);
12961292

12971293
if (!on != aniState->ofdmWeakSigDetectOff) {
1298-
ath_dbg(common, ATH_DBG_ANI,
1294+
ath_dbg(common, ANI,
12991295
"** ch %d: ofdm weak signal: %s=>%s\n",
13001296
chan->channel,
13011297
!aniState->ofdmWeakSigDetectOff ?
@@ -1313,7 +1309,7 @@ static bool ar5008_hw_ani_control_new(struct ath_hw *ah,
13131309
u32 level = param;
13141310

13151311
if (level >= ARRAY_SIZE(firstep_table)) {
1316-
ath_dbg(common, ATH_DBG_ANI,
1312+
ath_dbg(common, ANI,
13171313
"ATH9K_ANI_FIRSTEP_LEVEL: level out of range (%u > %zu)\n",
13181314
level, ARRAY_SIZE(firstep_table));
13191315
return false;
@@ -1350,15 +1346,15 @@ static bool ar5008_hw_ani_control_new(struct ath_hw *ah,
13501346
AR_PHY_FIND_SIG_FIRSTEP_LOW, value2);
13511347

13521348
if (level != aniState->firstepLevel) {
1353-
ath_dbg(common, ATH_DBG_ANI,
1349+
ath_dbg(common, ANI,
13541350
"** ch %d: level %d=>%d[def:%d] firstep[level]=%d ini=%d\n",
13551351
chan->channel,
13561352
aniState->firstepLevel,
13571353
level,
13581354
ATH9K_ANI_FIRSTEP_LVL_NEW,
13591355
value,
13601356
aniState->iniDef.firstep);
1361-
ath_dbg(common, ATH_DBG_ANI,
1357+
ath_dbg(common, ANI,
13621358
"** ch %d: level %d=>%d[def:%d] firstep_low[level]=%d ini=%d\n",
13631359
chan->channel,
13641360
aniState->firstepLevel,
@@ -1378,7 +1374,7 @@ static bool ar5008_hw_ani_control_new(struct ath_hw *ah,
13781374
u32 level = param;
13791375

13801376
if (level >= ARRAY_SIZE(cycpwrThr1_table)) {
1381-
ath_dbg(common, ATH_DBG_ANI,
1377+
ath_dbg(common, ANI,
13821378
"ATH9K_ANI_SPUR_IMMUNITY_LEVEL: level out of range (%u > %zu)\n",
13831379
level, ARRAY_SIZE(cycpwrThr1_table));
13841380
return false;
@@ -1414,15 +1410,15 @@ static bool ar5008_hw_ani_control_new(struct ath_hw *ah,
14141410
AR_PHY_EXT_TIMING5_CYCPWR_THR1, value2);
14151411

14161412
if (level != aniState->spurImmunityLevel) {
1417-
ath_dbg(common, ATH_DBG_ANI,
1413+
ath_dbg(common, ANI,
14181414
"** ch %d: level %d=>%d[def:%d] cycpwrThr1[level]=%d ini=%d\n",
14191415
chan->channel,
14201416
aniState->spurImmunityLevel,
14211417
level,
14221418
ATH9K_ANI_SPUR_IMMUNE_LVL_NEW,
14231419
value,
14241420
aniState->iniDef.cycpwrThr1);
1425-
ath_dbg(common, ATH_DBG_ANI,
1421+
ath_dbg(common, ANI,
14261422
"** ch %d: level %d=>%d[def:%d] cycpwrThr1Ext[level]=%d ini=%d\n",
14271423
chan->channel,
14281424
aniState->spurImmunityLevel,
@@ -1448,11 +1444,11 @@ static bool ar5008_hw_ani_control_new(struct ath_hw *ah,
14481444
case ATH9K_ANI_PRESENT:
14491445
break;
14501446
default:
1451-
ath_dbg(common, ATH_DBG_ANI, "invalid cmd %u\n", cmd);
1447+
ath_dbg(common, ANI, "invalid cmd %u\n", cmd);
14521448
return false;
14531449
}
14541450

1455-
ath_dbg(common, ATH_DBG_ANI,
1451+
ath_dbg(common, ANI,
14561452
"ANI parameters: SI=%d, ofdmWS=%s FS=%d MRCcck=%s listenTime=%d ofdmErrs=%d cckErrs=%d\n",
14571453
aniState->spurImmunityLevel,
14581454
!aniState->ofdmWeakSigDetectOff ? "on" : "off",
@@ -1506,7 +1502,7 @@ static void ar5008_hw_ani_cache_ini_regs(struct ath_hw *ah)
15061502

15071503
iniDef = &aniState->iniDef;
15081504

1509-
ath_dbg(common, ATH_DBG_ANI, "ver %d.%d opmode %u chan %d Mhz/0x%x\n",
1505+
ath_dbg(common, ANI, "ver %d.%d opmode %u chan %d Mhz/0x%x\n",
15101506
ah->hw_version.macVersion,
15111507
ah->hw_version.macRev,
15121508
ah->opmode,

0 commit comments

Comments
 (0)