diff options
author | Brad Smith <brad@cvs.openbsd.org> | 2006-10-25 02:37:51 +0000 |
---|---|---|
committer | Brad Smith <brad@cvs.openbsd.org> | 2006-10-25 02:37:51 +0000 |
commit | 8ee15b10b0d7abb84bf7b98555da28cbd6d08fb0 (patch) | |
tree | 3f4b4a91ec050a8c9d353b84066e3011f95f66f6 | |
parent | 7b7ccf1aa0811dab9ff2d84954fa5e84b822e9f7 (diff) |
replace a few more instances of hand rolled code with the
LIST_FOREACH macro.
-rw-r--r-- | sys/dev/pci/if_bge.c | 5 | ||||
-rw-r--r-- | sys/dev/pci/if_bnx.c | 5 | ||||
-rw-r--r-- | sys/dev/pci/if_lge.c | 7 | ||||
-rw-r--r-- | sys/dev/pci/if_nge.c | 7 | ||||
-rw-r--r-- | sys/dev/pci/if_wb.c | 5 |
5 files changed, 12 insertions, 17 deletions
diff --git a/sys/dev/pci/if_bge.c b/sys/dev/pci/if_bge.c index 3f186c2b100..41f71b66269 100644 --- a/sys/dev/pci/if_bge.c +++ b/sys/dev/pci/if_bge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_bge.c,v 1.191 2006/10/22 21:45:36 brad Exp $ */ +/* $OpenBSD: if_bge.c,v 1.192 2006/10/25 02:37:50 brad Exp $ */ /* * Copyright (c) 2001 Wind River Systems @@ -3006,8 +3006,7 @@ bge_ifmedia_upd(struct ifnet *ifp) sc->bge_link_evt++; if (mii->mii_instance) { struct mii_softc *miisc; - for (miisc = LIST_FIRST(&mii->mii_phys); miisc != NULL; - miisc = LIST_NEXT(miisc, mii_list)) + LIST_FOREACH(miisc, &mii->mii_phys, mii_list) mii_phy_reset(miisc); } mii_mediachg(mii); diff --git a/sys/dev/pci/if_bnx.c b/sys/dev/pci/if_bnx.c index 2b52cb5147c..3d822795dea 100644 --- a/sys/dev/pci/if_bnx.c +++ b/sys/dev/pci/if_bnx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_bnx.c,v 1.30 2006/10/22 20:27:41 brad Exp $ */ +/* $OpenBSD: if_bnx.c,v 1.31 2006/10/25 02:37:50 brad Exp $ */ /*- * Copyright (c) 2006 Broadcom Corporation @@ -3619,8 +3619,7 @@ bnx_ifmedia_upd(struct ifnet *ifp) sc->bnx_link = 0; if (mii->mii_instance) { struct mii_softc *miisc; - for (miisc = LIST_FIRST(&mii->mii_phys); miisc != NULL; - miisc = LIST_NEXT(miisc, mii_list)) + LIST_FOREACH(miisc, &mii->mii_phys, mii_list) mii_phy_reset(miisc); } mii_mediachg(mii); diff --git a/sys/dev/pci/if_lge.c b/sys/dev/pci/if_lge.c index 506e460df6c..9b0c7142aeb 100644 --- a/sys/dev/pci/if_lge.c +++ b/sys/dev/pci/if_lge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_lge.c,v 1.44 2006/05/28 00:20:21 brad Exp $ */ +/* $OpenBSD: if_lge.c,v 1.45 2006/10/25 02:37:50 brad Exp $ */ /* * Copyright (c) 2001 Wind River Systems * Copyright (c) 1997, 1998, 1999, 2000, 2001 @@ -1345,9 +1345,8 @@ lge_ifmedia_upd(struct ifnet *ifp) sc->lge_link = 0; if (mii->mii_instance) { - struct mii_softc *miisc; - for (miisc = LIST_FIRST(&mii->mii_phys); miisc != NULL; - miisc = LIST_NEXT(miisc, mii_list)) + struct mii_softc *miisc; + LIST_FOREACH(miisc, &mii->mii_phys, mii_list) mii_phy_reset(miisc); } mii_mediachg(mii); diff --git a/sys/dev/pci/if_nge.c b/sys/dev/pci/if_nge.c index 00d0375e46b..03eaf8828ec 100644 --- a/sys/dev/pci/if_nge.c +++ b/sys/dev/pci/if_nge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_nge.c,v 1.55 2006/05/28 00:20:21 brad Exp $ */ +/* $OpenBSD: if_nge.c,v 1.56 2006/10/25 02:37:50 brad Exp $ */ /* * Copyright (c) 2001 Wind River Systems * Copyright (c) 1997, 1998, 1999, 2000, 2001 @@ -1907,9 +1907,8 @@ nge_ifmedia_mii_upd(ifp) sc->nge_link = 0; if (mii->mii_instance) { - struct mii_softc *miisc; - for (miisc = LIST_FIRST(&mii->mii_phys); miisc != NULL; - miisc = LIST_NEXT(miisc, mii_list)) + struct mii_softc *miisc; + LIST_FOREACH(miisc, &mii->mii_phys, mii_list) mii_phy_reset(miisc); } mii_mediachg(mii); diff --git a/sys/dev/pci/if_wb.c b/sys/dev/pci/if_wb.c index 3b07a48eaa3..7225f3462d5 100644 --- a/sys/dev/pci/if_wb.c +++ b/sys/dev/pci/if_wb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_wb.c,v 1.35 2006/05/28 00:04:24 jason Exp $ */ +/* $OpenBSD: if_wb.c,v 1.36 2006/10/25 02:37:50 brad Exp $ */ /* * Copyright (c) 1997, 1998 @@ -654,8 +654,7 @@ wb_reset(sc) if (mii->mii_instance) { struct mii_softc *miisc; - for (miisc = LIST_FIRST(&mii->mii_phys); miisc != NULL; - miisc = LIST_NEXT(miisc, mii_list)) + LIST_FOREACH(miisc, &mii->mii_phys, mii_list) mii_phy_reset(miisc); } } |