wlan-ng: clean up prism2sta_inf_chinforesults()
This function is ugly because it hits against the 80 character limit. This patch does several things to clean it up. 1) Introduces "result" instead of inf->info.chinforesult.result[n]. 2) Reverses the ".scanchannels & (1 << i)" so everthing can be pulled in one indent level. 3) Use "chan" instead of "channel". 4) Tweaks the line breaks to the call to pr_debug(). Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
c19e94613e
commit
a0cdd2e4a9
@@ -1160,30 +1160,30 @@ static void prism2sta_inf_chinforesults(wlandevice_t *wlandev,
|
|||||||
le16_to_cpu(inf->info.chinforesult.scanchannels);
|
le16_to_cpu(inf->info.chinforesult.scanchannels);
|
||||||
|
|
||||||
for (i = 0, n = 0; i < HFA384x_CHINFORESULT_MAX; i++) {
|
for (i = 0, n = 0; i < HFA384x_CHINFORESULT_MAX; i++) {
|
||||||
if (hw->channel_info.results.scanchannels & (1 << i)) {
|
hfa384x_ChInfoResultSub_t *result;
|
||||||
int channel =
|
hfa384x_ChInfoResultSub_t *chinforesult;
|
||||||
le16_to_cpu(inf->info.chinforesult.result[n].chid) -
|
int chan;
|
||||||
1;
|
|
||||||
hfa384x_ChInfoResultSub_t *chinforesult =
|
if (!(hw->channel_info.results.scanchannels & (1 << i)))
|
||||||
&hw->channel_info.results.result[channel];
|
continue;
|
||||||
chinforesult->chid = channel;
|
|
||||||
chinforesult->anl =
|
result = &inf->info.chinforesult.result[n];
|
||||||
le16_to_cpu(inf->info.chinforesult.result[n].anl);
|
chan = le16_to_cpu(result->chid) - 1;
|
||||||
chinforesult->pnl =
|
|
||||||
le16_to_cpu(inf->info.chinforesult.result[n].pnl);
|
chinforesult = &hw->channel_info.results.result[chan];
|
||||||
chinforesult->active =
|
chinforesult->chid = chan;
|
||||||
le16_to_cpu(inf->info.chinforesult.result[n].
|
chinforesult->anl = le16_to_cpu(result->anl);
|
||||||
active);
|
chinforesult->pnl = le16_to_cpu(result->pnl);
|
||||||
pr_debug
|
chinforesult->active = le16_to_cpu(result->active);
|
||||||
("chinfo: channel %d, %s level (avg/peak)=%d/%d dB, pcf %d\n",
|
|
||||||
channel + 1,
|
pr_debug("chinfo: channel %d, %s level (avg/peak)=%d/%d dB, pcf %d\n",
|
||||||
chinforesult->
|
chan + 1,
|
||||||
active & HFA384x_CHINFORESULT_BSSACTIVE ? "signal"
|
(chinforesult->active & HFA384x_CHINFORESULT_BSSACTIVE)
|
||||||
: "noise", chinforesult->anl, chinforesult->pnl,
|
? "signal" : "noise",
|
||||||
chinforesult->
|
chinforesult->anl, chinforesult->pnl,
|
||||||
active & HFA384x_CHINFORESULT_PCFACTIVE ? 1 : 0);
|
(chinforesult->active & HFA384x_CHINFORESULT_PCFACTIVE)
|
||||||
n++;
|
? 1 : 0);
|
||||||
}
|
n++;
|
||||||
}
|
}
|
||||||
atomic_set(&hw->channel_info.done, 2);
|
atomic_set(&hw->channel_info.done, 2);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user