Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/nick-nhusb]: src/sys/dev/usb Use __arraycount
details: https://anonhg.NetBSD.org/src/rev/d8679648b3df
branches: nick-nhusb
changeset: 334260:d8679648b3df
user: skrll <skrll%NetBSD.org@localhost>
date: Wed Oct 07 10:39:25 2015 +0000
description:
Use __arraycount
diffstat:
sys/dev/usb/if_rum.c | 12 ++++--------
sys/dev/usb/if_ural.c | 12 ++++--------
2 files changed, 8 insertions(+), 16 deletions(-)
diffs (135 lines):
diff -r be4399de4376 -r d8679648b3df sys/dev/usb/if_rum.c
--- a/sys/dev/usb/if_rum.c Tue Oct 06 21:32:15 2015 +0000
+++ b/sys/dev/usb/if_rum.c Wed Oct 07 10:39:25 2015 +0000
@@ -1,5 +1,5 @@
/* $OpenBSD: if_rum.c,v 1.40 2006/09/18 16:20:20 damien Exp $ */
-/* $NetBSD: if_rum.c,v 1.48.6.10 2015/10/06 21:32:15 skrll Exp $ */
+/* $NetBSD: if_rum.c,v 1.48.6.11 2015/10/07 10:39:25 skrll Exp $ */
/*-
* Copyright (c) 2005-2007 Damien Bergamini <damien.bergamini%free.fr@localhost>
@@ -24,7 +24,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_rum.c,v 1.48.6.10 2015/10/06 21:32:15 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_rum.c,v 1.48.6.11 2015/10/07 10:39:25 skrll Exp $");
#include <sys/param.h>
#include <sys/sockio.h>
@@ -1930,7 +1930,6 @@
static int
rum_bbp_init(struct rum_softc *sc)
{
-#define N(a) (sizeof (a) / sizeof ((a)[0]))
unsigned int i, ntries;
uint8_t val;
@@ -1948,7 +1947,7 @@
}
/* initialize BBP registers to default values */
- for (i = 0; i < N(rum_def_bbp); i++)
+ for (i = 0; i < __arraycount(rum_def_bbp); i++)
rum_bbp_write(sc, rum_def_bbp[i].reg, rum_def_bbp[i].val);
/* write vendor-specific BBP values (from EEPROM) */
@@ -1959,13 +1958,11 @@
}
return 0;
-#undef N
}
static int
rum_init(struct ifnet *ifp)
{
-#define N(a) (sizeof (a) / sizeof ((a)[0]))
struct rum_softc *sc = ifp->if_softc;
struct ieee80211com *ic = &sc->sc_ic;
uint32_t tmp;
@@ -1980,7 +1977,7 @@
rum_stop(ifp, 0);
/* initialize MAC registers to default values */
- for (i = 0; i < N(rum_def_mac); i++)
+ for (i = 0; i < __arraycount(rum_def_mac); i++)
rum_write(sc, rum_def_mac[i].reg, rum_def_mac[i].val);
/* set host ready */
@@ -2110,7 +2107,6 @@
fail: rum_stop(ifp, 1);
return error;
-#undef N
}
static void
diff -r be4399de4376 -r d8679648b3df sys/dev/usb/if_ural.c
--- a/sys/dev/usb/if_ural.c Tue Oct 06 21:32:15 2015 +0000
+++ b/sys/dev/usb/if_ural.c Wed Oct 07 10:39:25 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_ural.c,v 1.44.14.7 2015/10/06 21:32:15 skrll Exp $ */
+/* $NetBSD: if_ural.c,v 1.44.14.8 2015/10/07 10:39:25 skrll Exp $ */
/* $FreeBSD: /repoman/r/ncvs/src/sys/dev/usb/if_ural.c,v 1.40 2006/06/02 23:14:40 sam Exp $ */
/*-
@@ -24,7 +24,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ural.c,v 1.44.14.7 2015/10/06 21:32:15 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ural.c,v 1.44.14.8 2015/10/07 10:39:25 skrll Exp $");
#include <sys/param.h>
#include <sys/sockio.h>
@@ -2007,7 +2007,6 @@
Static int
ural_bbp_init(struct ural_softc *sc)
{
-#define N(a) (sizeof (a) / sizeof ((a)[0]))
int i, ntries;
/* wait for BBP to be ready */
@@ -2022,7 +2021,7 @@
}
/* initialize BBP registers to default values */
- for (i = 0; i < N(ural_def_bbp); i++)
+ for (i = 0; i < __arraycount(ural_def_bbp); i++)
ural_bbp_write(sc, ural_def_bbp[i].reg, ural_def_bbp[i].val);
#if 0
@@ -2035,7 +2034,6 @@
#endif
return 0;
-#undef N
}
Static void
@@ -2090,7 +2088,6 @@
Static int
ural_init(struct ifnet *ifp)
{
-#define N(a) (sizeof (a) / sizeof ((a)[0]))
struct ural_softc *sc = ifp->if_softc;
struct ieee80211com *ic = &sc->sc_ic;
struct ieee80211_key *wk;
@@ -2104,7 +2101,7 @@
ural_stop(ifp, 0);
/* initialize MAC registers to default values */
- for (i = 0; i < N(ural_def_mac); i++)
+ for (i = 0; i < __arraycount(ural_def_mac); i++)
ural_write(sc, ural_def_mac[i].reg, ural_def_mac[i].val);
/* wait for BBP and RF to wake up (this can take a long time!) */
@@ -2235,7 +2232,6 @@
fail: ural_stop(ifp, 1);
return error;
-#undef N
}
Static void
Home |
Main Index |
Thread Index |
Old Index