summaryrefslogtreecommitdiffstats
path: root/sys/dev/iwi
diff options
context:
space:
mode:
authoradrian <adrian@FreeBSD.org>2015-09-22 02:44:59 +0000
committeradrian <adrian@FreeBSD.org>2015-09-22 02:44:59 +0000
commit5672e10cea195094b9e180a6fb22537a6f8f588e (patch)
tree3a012e5662121dbe0100d03ff4e42e00b0579eda /sys/dev/iwi
parent238d4c1fe4883c2fa85330fb7b5b88d8b869e977 (diff)
downloadFreeBSD-src-5672e10cea195094b9e180a6fb22537a6f8f588e.zip
FreeBSD-src-5672e10cea195094b9e180a6fb22537a6f8f588e.tar.gz
net80211 & wireless drivers: remove duplicate defines (noop)
* IEEE80211_DIR_DSTODS(wh) -> IEEE80211_IS_DSTODS(wh). * N(a) -> nitems(a). * Remove LE_READ_2(p)/LE_READ_4(p) definitions (and include ieee80211_input.h instead). * <drvname>_TXOP_TO_US(txop) -> IEEE80211_TXOP_TO_US(txop). * Put IEEE80211_RV(v) into ieee80211_proto.h and remove local RV(v) definitions. Submitted by: Andriy Voskoboinyk <s3erios@gmail.com> Differential Revision: https://reviews.freebsd.org/D3705
Diffstat (limited to 'sys/dev/iwi')
-rw-r--r--sys/dev/iwi/if_iwi.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/sys/dev/iwi/if_iwi.c b/sys/dev/iwi/if_iwi.c
index 73631ea..c45a37f 100644
--- a/sys/dev/iwi/if_iwi.c
+++ b/sys/dev/iwi/if_iwi.c
@@ -3415,7 +3415,6 @@ iwi_led_blink(struct iwi_softc *sc, int on, int off)
static void
iwi_led_event(struct iwi_softc *sc, int event)
{
-#define N(a) (sizeof(a)/sizeof(a[0]))
/* NB: on/off times from the Atheros NDIS driver, w/ permission */
static const struct {
u_int rate; /* tx/rx iwi rate */
@@ -3445,13 +3444,13 @@ iwi_led_event(struct iwi_softc *sc, int event)
return;
switch (event) {
case IWI_LED_POLL:
- j = N(blinkrates)-1;
+ j = nitems(blinkrates)-1;
break;
case IWI_LED_TX:
/* read current transmission rate from adapter */
txrate = CSR_READ_4(sc, IWI_CSR_CURRENT_TX_RATE);
if (blinkrates[sc->sc_txrix].rate != txrate) {
- for (j = 0; j < N(blinkrates)-1; j++)
+ for (j = 0; j < nitems(blinkrates)-1; j++)
if (blinkrates[j].rate == txrate)
break;
sc->sc_txrix = j;
@@ -3460,7 +3459,7 @@ iwi_led_event(struct iwi_softc *sc, int event)
break;
case IWI_LED_RX:
if (blinkrates[sc->sc_rxrix].rate != sc->sc_rxrate) {
- for (j = 0; j < N(blinkrates)-1; j++)
+ for (j = 0; j < nitems(blinkrates)-1; j++)
if (blinkrates[j].rate == sc->sc_rxrate)
break;
sc->sc_rxrix = j;
@@ -3471,7 +3470,6 @@ iwi_led_event(struct iwi_softc *sc, int event)
/* XXX beware of overflow */
iwi_led_blink(sc, (blinkrates[j].timeOn * hz) / 1000,
(blinkrates[j].timeOff * hz) / 1000);
-#undef N
}
static int
OpenPOWER on IntegriCloud