summaryrefslogtreecommitdiffstats
path: root/sys/net80211/ieee80211_scan_sta.c
diff options
context:
space:
mode:
authorrpaulo <rpaulo@FreeBSD.org>2013-08-14 04:24:25 +0000
committerrpaulo <rpaulo@FreeBSD.org>2013-08-14 04:24:25 +0000
commitb66e5efc0f138709337bda97b97422177187cf60 (patch)
treeaab84fc7202136670f336f52bd4cbf358edc91cf /sys/net80211/ieee80211_scan_sta.c
parentcee1e037da7213db868bb6bfc99884926330de56 (diff)
downloadFreeBSD-src-b66e5efc0f138709337bda97b97422177187cf60.zip
FreeBSD-src-b66e5efc0f138709337bda97b97422177187cf60.tar.gz
Replace the homegrown implementation of nitems() with calls to nitems()
(param.h). Operating systems that don't have nitems() can easily define it on their own net80211 OS-specific header file. Discussed with: adrian
Diffstat (limited to 'sys/net80211/ieee80211_scan_sta.c')
-rw-r--r--sys/net80211/ieee80211_scan_sta.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/sys/net80211/ieee80211_scan_sta.c b/sys/net80211/ieee80211_scan_sta.c
index 381faca..c791ea1 100644
--- a/sys/net80211/ieee80211_scan_sta.c
+++ b/sys/net80211/ieee80211_scan_sta.c
@@ -450,13 +450,12 @@ add_channels(struct ieee80211vap *vap,
struct ieee80211_scan_state *ss,
enum ieee80211_phymode mode, const uint16_t freq[], int nfreq)
{
-#define N(a) (sizeof(a) / sizeof(a[0]))
struct ieee80211com *ic = vap->iv_ic;
struct ieee80211_channel *c, *cg;
u_int modeflags;
int i;
- KASSERT(mode < N(chanflags), ("Unexpected mode %u", mode));
+ KASSERT(mode < nitems(chanflags), ("Unexpected mode %u", mode));
modeflags = chanflags[mode];
for (i = 0; i < nfreq; i++) {
if (ss->ss_last >= IEEE80211_SCAN_MAX)
@@ -476,7 +475,6 @@ add_channels(struct ieee80211vap *vap,
}
ss->ss_chans[ss->ss_last++] = c;
}
-#undef N
}
struct scanlist {
OpenPOWER on IntegriCloud