Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/net KNF and trailing whitespace. No functional change.
details: https://anonhg.NetBSD.org/src/rev/f02f8e67e832
branches: trunk
changeset: 351215:f02f8e67e832
user: skrll <skrll%NetBSD.org@localhost>
date: Tue Feb 07 11:17:50 2017 +0000
description:
KNF and trailing whitespace. No functional change.
diffstat:
sys/net/if_tap.c | 86 ++++++++++++++++++++++++++++----------------------------
1 files changed, 43 insertions(+), 43 deletions(-)
diffs (truncated from 335 to 300 lines):
diff -r 564f3d41c0b1 -r f02f8e67e832 sys/net/if_tap.c
--- a/sys/net/if_tap.c Tue Feb 07 09:14:52 2017 +0000
+++ b/sys/net/if_tap.c Tue Feb 07 11:17:50 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_tap.c,v 1.94 2016/12/15 09:28:06 ozaki-r Exp $ */
+/* $NetBSD: if_tap.c,v 1.95 2017/02/07 11:17:50 skrll Exp $ */
/*
* Copyright (c) 2003, 2004, 2008, 2009 The NetBSD Foundation.
@@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_tap.c,v 1.94 2016/12/15 09:28:06 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_tap.c,v 1.95 2017/02/07 11:17:50 skrll Exp $");
#if defined(_KERNEL_OPT)
@@ -259,7 +259,7 @@
(void)config_cfdriver_detach(&tap_cd);
return;
}
-
+
if_clone_attach(&tap_cloners);
sysctl_tap_setup(&tap_sysctl_clog);
#ifdef _MODULE
@@ -295,7 +295,7 @@
tap_match(device_t parent, cfdata_t cfdata, void *arg)
{
- return (1);
+ return 1;
}
void
@@ -449,7 +449,7 @@
pmf_device_deregister(self);
- return (0);
+ return 0;
}
/*
@@ -460,7 +460,7 @@
static int
tap_mediachange(struct ifnet *ifp)
{
- return (0);
+ return 0;
}
/*
@@ -587,7 +587,7 @@
splx(s);
- return (error);
+ return error;
}
/*
@@ -600,11 +600,11 @@
const struct sockaddr *sa = &ifra->ifra_addr;
if (sa->sa_family != AF_LINK)
- return (EINVAL);
+ return EINVAL;
if_set_sadl(ifp, sa->sa_data, ETHER_ADDR_LEN, false);
- return (0);
+ return 0;
}
/*
@@ -619,7 +619,7 @@
tap_start(ifp);
- return (0);
+ return 0;
}
/*
@@ -655,10 +655,10 @@
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;
}
atomic_inc_uint(&tap_count);
- return (0);
+ return 0;
}
/*
@@ -714,7 +714,7 @@
aprint_error_dev(dev, "unable to detach instance\n");
free(cf, M_DEVBUF);
- return (error);
+ return error;
}
/*
@@ -749,13 +749,13 @@
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);
+ return EBUSY;
sc->sc_flags |= TAP_INUSE;
- return (0);
+ return 0;
}
/*
@@ -788,11 +788,11 @@
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;
@@ -819,7 +819,7 @@
device_lookup_private(&tap_cd, minor(dev));
if (sc == NULL)
- return (ENXIO);
+ return ENXIO;
return tap_dev_close(sc);
}
@@ -839,21 +839,21 @@
sc = device_lookup_private(&tap_cd, unit);
if (sc == NULL)
- return (ENXIO);
+ return ENXIO;
/* tap_dev_close currently always succeeds, but it might not
* always be the case. */
KERNEL_LOCK(1, NULL);
if ((error = tap_dev_close(sc)) != 0) {
KERNEL_UNLOCK_ONE(NULL);
- return (error);
+ return error;
}
/* Destroy the device now that it is no longer useful,
* unless it's already being destroyed. */
if ((sc->sc_flags & TAP_GOING) != 0) {
KERNEL_UNLOCK_ONE(NULL);
- return (0);
+ return 0;
}
error = tap_clone_destroyer(sc->sc_dev);
@@ -894,7 +894,7 @@
}
sc->sc_flags &= ~(TAP_INUSE | TAP_ASYNCIO);
- return (0);
+ return 0;
}
static int
@@ -924,20 +924,20 @@
int error = 0, s;
if (sc == NULL)
- return (ENXIO);
+ return ENXIO;
getnanotime(&sc->sc_atime);
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);
}
@@ -957,13 +957,13 @@
splx(s);
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);
}
@@ -995,7 +995,7 @@
out:
mutex_exit(&sc->sc_rdlock);
- return (error);
+ return error;
}
static int
@@ -1054,7 +1054,7 @@
int s;
if (sc == NULL)
- return (ENXIO);
+ return ENXIO;
getnanotime(&sc->sc_mtime);
ifp = &sc->sc_ec.ec_if;
@@ -1063,7 +1063,7 @@
MGETHDR(m, M_DONTWAIT, MT_DATA);
if (m == NULL) {
ifp->if_ierrors++;
- return (ENOBUFS);
+ return ENOBUFS;
}
m->m_pkthdr.len = uio->uio_resid;
@@ -1083,7 +1083,7 @@
if (error) {
ifp->if_ierrors++;
m_freem(m);
- return (error);
+ return error;
}
m_set_rcvif(m, ifp);
@@ -1092,7 +1092,7 @@
if_input(ifp, m);
splx(s);
- return (0);
+ return 0;
}
static int
@@ -1132,7 +1132,7 @@
*(int *)data = m->m_pkthdr.len;
splx(s);
return 0;
- }
+ }
case TIOCSPGRP:
case FIOSETOWN:
return fsetown(&sc->sc_pgid, cmd, data);
@@ -1219,7 +1219,7 @@
}
revents |= events & (POLLOUT|POLLWRNORM);
- return (revents);
+ return revents;
}
static struct filterops tap_read_filterops = { 1, NULL, tap_kqdetach,
@@ -1246,7 +1246,7 @@
device_lookup_private(&tap_cd, unit);
if (sc == NULL)
- return (ENXIO);
+ return ENXIO;
KERNEL_LOCK(1, NULL);
switch(kn->kn_filter) {
@@ -1258,7 +1258,7 @@
break;
default:
KERNEL_UNLOCK_ONE(NULL);
- return (EINVAL);
Home |
Main Index |
Thread Index |
Old Index