summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2006-10-17 22:22:50 +0000
committerBrad Smith <brad@cvs.openbsd.org>2006-10-17 22:22:50 +0000
commite97741005e22db58b39ae79eb38000dcf11f905c (patch)
tree8337ba054f425d59e31fc364a78bd08138c7eef3 /sys
parent24417e5483a07921ef420f843a48cc993882a2bd (diff)
replace hand rolled code with LIST_FOREACH in gem_mediachange().
ok kettenis@ "Looks correct to me" krw@
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ic/gem.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/dev/ic/gem.c b/sys/dev/ic/gem.c
index fdf65f5858c..413d0f7d945 100644
--- a/sys/dev/ic/gem.c
+++ b/sys/dev/ic/gem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: gem.c,v 1.59 2006/07/11 00:52:38 brad Exp $ */
+/* $OpenBSD: gem.c,v 1.60 2006/10/17 22:22:49 brad Exp $ */
/* $NetBSD: gem.c,v 1.1 2001/09/16 00:11:43 eeh Exp $ */
/*
@@ -1316,10 +1316,9 @@ gem_mediachange(ifp)
struct mii_data *mii = &sc->sc_mii;
if (mii->mii_instance) {
- struct mii_softc *miisc;
- for (miisc = LIST_FIRST(&mii->mii_phys); miisc != NULL;
- miisc = LIST_NEXT(miisc, mii_list))
- mii_phy_reset(miisc);
+ struct mii_softc *miisc;
+ LIST_FOREACH(miisc, &mii->mii_phys, mii_list)
+ mii_phy_reset(miisc);
}
return (mii_mediachg(&sc->sc_mii));