summaryrefslogtreecommitdiffstats
path: root/sys/net/if_tun.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2002-10-20 20:53:42 +0000
committerphk <phk@FreeBSD.org>2002-10-20 20:53:42 +0000
commite52af95236484cb26803930eabf7d4c1817e5b96 (patch)
treedc23051fed41fe333adbc312c62002fc5fee4e10 /sys/net/if_tun.c
parentd9cf8d547889228b79c739f549eaa1d96e78856e (diff)
downloadFreeBSD-src-e52af95236484cb26803930eabf7d4c1817e5b96.zip
FreeBSD-src-e52af95236484cb26803930eabf7d4c1817e5b96.tar.gz
Don't us an array[1], it just hides where '&' isn't used right.
Be consistent about functions being static. Verified by: md5 hash of generated .o file.
Diffstat (limited to 'sys/net/if_tun.c')
-rw-r--r--sys/net/if_tun.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/sys/net/if_tun.c b/sys/net/if_tun.c
index cb9cb69..88051d2 100644
--- a/sys/net/if_tun.c
+++ b/sys/net/if_tun.c
@@ -59,7 +59,7 @@
static MALLOC_DEFINE(M_TUN, TUNNAME, "Tunnel Interface");
static int tundebug = 0;
static struct tun_softc *tunhead = NULL;
-static struct rman tununits[1];
+static struct rman tununits;
static udev_t tunbasedev = NOUDEV;
SYSCTL_INT(_debug, OID_AUTO, if_tun_debug, CTLFLAG_RW, &tundebug, 0, "");
@@ -107,7 +107,7 @@ tunclone(void *arg, char *name, int namelen, dev_t *dev)
return;
if (strcmp(name, TUNNAME) == 0) {
- r = rman_reserve_resource(tununits, 0, TUN_MAXUNIT, 1,
+ r = rman_reserve_resource(&tununits, 0, TUN_MAXUNIT, 1,
RF_ALLOCATED | RF_ACTIVE, NULL);
u = rman_get_start(r);
err = rman_release_resource(r);
@@ -154,26 +154,26 @@ tunmodevent(module_t mod, int type, void *data)
return (err);
}
}
- tununits->rm_type = RMAN_ARRAY;
- tununits->rm_descr = "open if_tun units";
- err = rman_init(tununits);
+ tununits.rm_type = RMAN_ARRAY;
+ tununits.rm_descr = "open if_tun units";
+ err = rman_init(&tununits);
if (err != 0) {
cdevsw_remove(&tun_cdevsw);
EVENTHANDLER_DEREGISTER(dev_clone, tag);
return (err);
}
- err = rman_manage_region(tununits, 0, TUN_MAXUNIT);
+ err = rman_manage_region(&tununits, 0, TUN_MAXUNIT);
if (err != 0) {
printf("%s: tununits: rman_manage_region: Failed %d\n",
TUNNAME, err);
- rman_fini(tununits);
+ rman_fini(&tununits);
cdevsw_remove(&tun_cdevsw);
EVENTHANDLER_DEREGISTER(dev_clone, tag);
return (err);
}
break;
case MOD_UNLOAD:
- err = rman_fini(tununits);
+ err = rman_fini(&tununits);
if (err != 0)
return (err);
EVENTHANDLER_DEREGISTER(dev_clone, tag);
@@ -272,7 +272,7 @@ tunopen(dev_t dev, int flag, int mode, struct thread *td)
if (unit > TUN_MAXUNIT)
return (ENXIO);
- r = rman_reserve_resource(tununits, unit, unit, 1,
+ r = rman_reserve_resource(&tununits, unit, unit, 1,
RF_ALLOCATED | RF_ACTIVE, NULL);
if (r == NULL)
return (EBUSY);
@@ -386,7 +386,7 @@ tuninit(struct ifnet *ifp)
/*
* Process an ioctl request.
*/
-int
+static int
tunifioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
{
struct ifreq *ifr = (struct ifreq *)data;
@@ -430,7 +430,7 @@ tunifioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
/*
* tunoutput - queue packets from higher level ready to put out.
*/
-int
+static int
tunoutput(
struct ifnet *ifp,
struct mbuf *m0,
OpenPOWER on IntegriCloud