diff options
author | glebius <glebius@FreeBSD.org> | 2015-01-09 12:26:08 +0000 |
---|---|---|
committer | glebius <glebius@FreeBSD.org> | 2015-01-09 12:26:08 +0000 |
commit | 1e3fe0af5935328dd09f7fe07560a289242a4af1 (patch) | |
tree | d546b2edaf7d8bccea7bf800467e87b611723da7 | |
parent | 48e613fbd84b0ad592a5b970bd8d96cc81e812e9 (diff) | |
download | FreeBSD-src-1e3fe0af5935328dd09f7fe07560a289242a4af1.zip FreeBSD-src-1e3fe0af5935328dd09f7fe07560a289242a4af1.tar.gz |
Use nitems().
-rw-r--r-- | sys/dev/mii/truephy.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/sys/dev/mii/truephy.c b/sys/dev/mii/truephy.c index 298b87e..47344cb 100644 --- a/sys/dev/mii/truephy.c +++ b/sys/dev/mii/truephy.c @@ -244,9 +244,7 @@ truephy_reset(struct mii_softc *sc) PHY_WRITE(sc, TRUEPHY_CTRL, TRUEPHY_CTRL_DIAG | TRUEPHY_CTRL_RSV1 | TRUEPHY_CTRL_RSV0); -#define N(arr) (int)(sizeof(arr) / sizeof(arr[0])) - - for (i = 0; i < N(truephy_dspcode); ++i) { + for (i = 0; i < nitems(truephy_dspcode); ++i) { const struct truephy_dsp *dsp = &truephy_dspcode[i]; PHY_WRITE(sc, TRUEPHY_INDEX, dsp->index); @@ -256,8 +254,6 @@ truephy_reset(struct mii_softc *sc) PHY_READ(sc, TRUEPHY_DATA); } -#undef N - PHY_READ(sc, MII_BMCR); PHY_READ(sc, TRUEPHY_CTRL); PHY_WRITE(sc, MII_BMCR, BMCR_AUTOEN | BMCR_S1000); |