svn commit: r213962 - stable/8/sys/dev/mii

Marius Strobl marius at FreeBSD.org
Sun Oct 17 12:33:16 UTC 2010


Author: marius
Date: Sun Oct 17 12:33:15 2010
New Revision: 213962
URL: http://svn.freebsd.org/changeset/base/213962

Log:
  MFC: r213361
  
  Try to adhere to style(9) and be consistent within this file.

Modified:
  stable/8/sys/dev/mii/mii.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/mii/mii.c
==============================================================================
--- stable/8/sys/dev/mii/mii.c	Sun Oct 17 12:30:01 2010	(r213961)
+++ stable/8/sys/dev/mii/mii.c	Sun Oct 17 12:33:15 2010	(r213962)
@@ -128,7 +128,7 @@ miibus_probe(device_t dev)
 	 	 */
 		bmsr = MIIBUS_READREG(parent, ma.mii_phyno, MII_BMSR);
 		if (bmsr == 0 || bmsr == 0xffff ||
-		    (bmsr & (BMSR_EXTSTAT|BMSR_MEDIAMASK)) == 0) {
+		    (bmsr & (BMSR_EXTSTAT | BMSR_MEDIAMASK)) == 0) {
 			/* Assume no PHY at this address. */
 			continue;
 		}
@@ -154,11 +154,11 @@ miibus_probe(device_t dev)
 	}
 
 	if (child == NULL)
-		return(ENXIO);
+		return (ENXIO);
 
 	device_set_desc(dev, "MII bus");
 
-	return(0);
+	return (0);
 }
 
 int
@@ -180,7 +180,7 @@ miibus_attach(device_t dev)
 	    ivars->ifmedia_sts);
 	bus_generic_attach(dev);
 
-	return(0);
+	return (0);
 }
 
 int
@@ -193,7 +193,7 @@ miibus_detach(device_t dev)
 	ifmedia_removeall(&mii->mii_media);
 	mii->mii_ifp = NULL;
 
-	return(0);
+	return (0);
 }
 
 static int
@@ -214,10 +214,12 @@ static int
 miibus_child_pnpinfo_str(device_t bus, device_t child, char *buf,
     size_t buflen)
 {
-	struct mii_attach_args *maa = device_get_ivars(child);
+	struct mii_attach_args *ma;
+
+	ma = device_get_ivars(child);
 	snprintf(buf, buflen, "oui=0x%x model=0x%x rev=0x%x",
-	    MII_OUI(maa->mii_id1, maa->mii_id2),
-	    MII_MODEL(maa->mii_id2), MII_REV(maa->mii_id2));
+	    MII_OUI(ma->mii_id1, ma->mii_id2),
+	    MII_MODEL(ma->mii_id2), MII_REV(ma->mii_id2));
 	return (0);
 }
 
@@ -225,8 +227,10 @@ static int
 miibus_child_location_str(device_t bus, device_t child, char *buf,
     size_t buflen)
 {
-	struct mii_attach_args *maa = device_get_ivars(child);
-	snprintf(buf, buflen, "phyno=%d", maa->mii_phyno);
+	struct mii_attach_args *ma;
+
+	ma = device_get_ivars(child);
+	snprintf(buf, buflen, "phyno=%d", ma->mii_phyno);
 	return (0);
 }
 
@@ -236,7 +240,7 @@ miibus_readreg(device_t dev, int phy, in
 	device_t		parent;
 
 	parent = device_get_parent(dev);
-	return(MIIBUS_READREG(parent, phy, reg));
+	return (MIIBUS_READREG(parent, phy, reg));
 }
 
 static int
@@ -245,7 +249,7 @@ miibus_writereg(device_t dev, int phy, i
 	device_t		parent;
 
 	parent = device_get_parent(dev);
-	return(MIIBUS_WRITEREG(parent, phy, reg, data));
+	return (MIIBUS_WRITEREG(parent, phy, reg, data));
 }
 
 static void
@@ -266,7 +270,6 @@ miibus_statchg(device_t dev)
 	 */
 	ifp = *(struct ifnet **)device_get_softc(parent);
 	ifp->if_baudrate = ifmedia_baudrate(mii->mii_media_active);
-	return;
 }
 
 static void
@@ -308,13 +311,11 @@ miibus_mediainit(device_t dev)
 	mii = device_get_softc(dev);
 	LIST_FOREACH(m, &mii->mii_media.ifm_list, ifm_list) {
 		media = m->ifm_media;
-		if (media == (IFM_ETHER|IFM_AUTO))
+		if (media == (IFM_ETHER | IFM_AUTO))
 			break;
 	}
 
 	ifmedia_set(&mii->mii_media, media);
-
-	return;
 }
 
 int
@@ -335,7 +336,7 @@ mii_phy_probe(device_t dev, device_t *ch
 	for (i = 0; i < MII_NPHY; i++) {
 		bmsr = MIIBUS_READREG(dev, i, MII_BMSR);
                 if (bmsr == 0 || bmsr == 0xffff ||
-                    (bmsr & (BMSR_EXTSTAT|BMSR_MEDIAMASK)) == 0) {
+                    (bmsr & (BMSR_EXTSTAT | BMSR_MEDIAMASK)) == 0) {
                         /* Assume no PHY at this address. */
                         continue;
                 } else
@@ -345,12 +346,12 @@ mii_phy_probe(device_t dev, device_t *ch
 	if (i == MII_NPHY) {
 		device_delete_child(dev, *child);
 		*child = NULL;
-		return(ENXIO);
+		return (ENXIO);
 	}
 
 	bus_generic_attach(dev);
 
-	return(0);
+	return (0);
 }
 
 /*
@@ -382,7 +383,7 @@ mii_tick(struct mii_data *mii)
 	struct mii_softc *child;
 
 	LIST_FOREACH(child, &mii->mii_phys, mii_list)
-		(void) (*child->mii_service)(child, mii, MII_TICK);
+		(void)(*child->mii_service)(child, mii, MII_TICK);
 }
 
 /*
@@ -397,7 +398,7 @@ mii_pollstat(struct mii_data *mii)
 	mii->mii_media_active = IFM_NONE;
 
 	LIST_FOREACH(child, &mii->mii_phys, mii_list)
-		(void) (*child->mii_service)(child, mii, MII_POLLSTAT);
+		(void)(*child->mii_service)(child, mii, MII_POLLSTAT);
 }
 
 /*


More information about the svn-src-all mailing list