Subject: [PATCH] kill useless parenthesis around return statement + KNF

From: Arnaud Lacombe <[email-masked]>
Date: Sat, 13 Sep 2008 01:52:59 -0400

---
 sys/net/if_tap.c |   71 +++++++++++++++++++++++++++--------------------------
 1 files changed, 36 insertions(+), 35 deletions(-)

diff --git a/sys/net/if_tap.c b/sys/net/if_tap.c
index e650e50..24b2861 100644
--- a/sys/net/if_tap.c
+++ b/sys/net/if_tap.c
@@ -243,7 +243,7 @@ static int
 tap_match(device_t parent, cfdata_t cfdata, void *arg)
 {
 
-	return (1);
+	return 1;
 }
 
 void
@@ -406,7 +406,7 @@ tap_detach(device_t self, int flags)
 
 	pmf_device_deregister(self);
 
-	return (0);
+	return 0;
 }
 
 /*
@@ -417,7 +417,8 @@ tap_detach(device_t self, int flags)
 static int
 tap_mediachange(struct ifnet *ifp)
 {
-	return (0);
+
+	return 0;
 }
 
 /*
@@ -548,7 +549,7 @@ tap_ioctl(struct ifnet *ifp, u_long cmd, void *data)
 
 	splx(s);
 
-	return (error);
+	return error;
 }
 
 /*
@@ -565,7 +566,7 @@ tap_lifaddr(struct ifnet *ifp, u_long cmd, struct ifaliasreq *ifra)
 
 	if_set_sadl(ifp, CLLADDR(sdl), ETHER_ADDR_LEN);
 
-	return (0);
+	return 0;
 }
 
 /*
@@ -581,7 +582,7 @@ tap_init(struct ifnet *ifp)
 
 	tap_start(ifp);
 
-	return (0);
+	return 0;
 }
 
 /*
@@ -618,10 +619,10 @@ tap_clone_create(struct if_clone *ifc, int unit)
 	if (tap_clone_creator(unit) == NULL) {
 		aprint_error("%s%d: unable to attach an instance\n",
                     tap_cd.cd_name, unit);
-		return (ENXIO);
+		return ENXIO;
 	}
 
-	return (0);
+	return 0;
 }
 
 /*
@@ -674,7 +675,7 @@ tap_clone_destroyer(struct tap_softc *sc)
 		aprint_error_dev(sc->sc_dev, "unable to detach instance\n");
 	free(cf, M_DEVBUF);
 
-	return (error);
+	return error;
 }
 
 /*
@@ -715,13 +716,13 @@ tap_cdev_open(dev_t dev, int flags, int fmt, struct lwp *l)
 
 	sc = device_lookup_private(&tap_cd, minor(dev));
 	if (sc == NULL)
-		return (ENXIO);
+		return ENXIO;
 
 	/* The device can only be opened once */
 	if (sc->sc_flags & TAP_INUSE)
 		return (EBUSY);
 	sc->sc_flags |= TAP_INUSE;
-	return (0);
+	return 0;
 }
 
 /*
@@ -754,11 +755,11 @@ tap_dev_cloner(struct vnode *vp)
 	int error, fd;
 
 	if ((error = fd_allocfile(&fp, &fd)) != 0)
-		return (error);
+		return error;
 
 	if ((sc = tap_clone_creator(-1)) == NULL) {
 		fd_abort(curproc, fp, fd);
-		return (ENXIO);
+		return ENXIO;
 	}
 
 	sc->sc_flags |= TAP_INUSE;
@@ -827,7 +828,7 @@ tap_dev_close(struct tap_softc *sc)
 	int s;
 
 	if (sc == NULL)
-		return (ENXIO);
+		return ENXIO;
 
 	s = splnet();
 	/* Let tap_start handle packets again */
@@ -854,7 +855,7 @@ tap_dev_close(struct tap_softc *sc)
 
 	sc->sc_flags &= ~(TAP_INUSE | TAP_ASYNCIO);
 
-	return (0);
+	return 0;
 }
 
 static int
@@ -885,18 +886,18 @@ tap_dev_read(struct tap_softc *sc, struct uio *uio, int flags)
 	int error = 0, s;
 
 	if (sc == NULL)
-		return (ENXIO);
+		return ENXIO;
 
 	ifp = &sc->sc_ec.ec_if;
 	if ((ifp->if_flags & IFF_UP) == 0)
-		return (EHOSTDOWN);
+		return EHOSTDOWN;
 
 	/*
 	 * In the TAP_NBIO case, we have to make sure we won't be sleeping
 	 */
 	if ((sc->sc_flags & TAP_NBIO) != 0) {
 		if (!mutex_tryenter(&sc->sc_rdlock))
-			return (EWOULDBLOCK);
+			return EWOULDBLOCK;
 	} else {
 		mutex_enter(&sc->sc_rdlock);
 	}
@@ -915,13 +916,13 @@ tap_dev_read(struct tap_softc *sc, struct uio *uio, int flags)
 		else
 			error = tsleep(sc, PSOCK|PCATCH, "tap", 0);
 		if (error != 0)
-			return (error);
+			return error;
 		/* The device might have been downed */
 		if ((ifp->if_flags & IFF_UP) == 0)
-			return (EHOSTDOWN);
+			return EHOSTDOWN;
 		if ((sc->sc_flags & TAP_NBIO)) {
 			if (!mutex_tryenter(&sc->sc_rdlock))
-				return (EWOULDBLOCK);
+				return EWOULDBLOCK;
 		} else {
 			mutex_enter(&sc->sc_rdlock);
 		}
@@ -957,7 +958,7 @@ tap_dev_read(struct tap_softc *sc, struct uio *uio, int flags)
 
 out:
 	mutex_exit(&sc->sc_rdlock);
-	return (error);
+	return error;
 }
 
 static int
@@ -989,7 +990,7 @@ tap_dev_write(struct tap_softc *sc, struct uio *uio, int flags)
 	int s;
 
 	if (sc == NULL)
-		return (ENXIO);
+		return ENXIO;
 
 	ifp = &sc->sc_ec.ec_if;
 
@@ -997,7 +998,7 @@ tap_dev_write(struct tap_softc *sc, struct uio *uio, int flags)
 	MGETHDR(m, M_DONTWAIT, MT_DATA);
 	if (m == NULL) {
 		ifp->if_ierrors++;
-		return (ENOBUFS);
+		return ENOBUFS;
 	}
 	m->m_pkthdr.len = uio->uio_resid;
 
@@ -1031,7 +1032,7 @@ tap_dev_write(struct tap_softc *sc, struct uio *uio, int flags)
 	(*ifp->if_input)(ifp, m);
 	splx(s);
 
-	return (0);
+	return 0;
 }
 
 static int
@@ -1055,7 +1056,7 @@ tap_dev_ioctl(struct tap_softc *sc, u_long cmd, void *data, struct lwp *l)
 	int error = 0;
 
 	if (sc == NULL)
-		return (ENXIO);
+		return ENXIO;
 
 	switch (cmd) {
 	case FIONREAD:
@@ -1108,7 +1109,7 @@ tap_dev_ioctl(struct tap_softc *sc, u_long cmd, void *data, struct lwp *l)
 		break;
 	}
 
-	return (0);
+	return 0;
 }
 
 static int
@@ -1153,7 +1154,7 @@ tap_dev_poll(struct tap_softc *sc, int events, struct lwp *l)
 	}
 	revents |= events & (POLLOUT|POLLWRNORM);
 
-	return (revents);
+	return revents;
 }
 
 static int
@@ -1196,7 +1197,7 @@ tap_dev_kqfilter(struct tap_softc *sc, struct knote *kn)
 {
 
 	if (sc == NULL)
-		return (ENXIO);
+		return ENXIO;
 
 	KERNEL_LOCK(1, NULL);
 	switch(kn->kn_filter) {
@@ -1208,7 +1209,7 @@ tap_dev_kqfilter(struct tap_softc *sc, struct knote *kn)
 		break;
 	default:
 		KERNEL_UNLOCK_ONE(NULL);
-		return (EINVAL);
+		return EINVAL;
 	}
 
 	kn->kn_hook = sc;
@@ -1216,7 +1217,7 @@ tap_dev_kqfilter(struct tap_softc *sc, struct knote *kn)
 	SLIST_INSERT_HEAD(&sc->sc_rsel.sel_klist, kn, kn_selnext);
 	simple_unlock(&sc->sc_kqlock);
 	KERNEL_UNLOCK_ONE(NULL);
-	return (0);
+	return 0;
 }
 
 static void
@@ -1371,15 +1372,15 @@ tap_sysctl_handler(SYSCTLFN_ARGS)
 	node.sysctl_data = addr;
 	error = sysctl_lookup(SYSCTLFN_CALL(&node));
 	if (error || newp == NULL)
-		return (error);
+		return error;
 
 	len = strlen(addr);
 	if (len < 11 || len > 17)
-		return (EINVAL);
+		return EINVAL;
 
 	/* Commit change */
 	if (ether_nonstatic_aton(enaddr, addr) != 0)
-		return (EINVAL);
+		return EINVAL;
 	if_set_sadl(ifp, enaddr, ETHER_ADDR_LEN);
-	return (error);
+	return error;
 }