summaryrefslogtreecommitdiffstats
path: root/sys/net/if_tun.c
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2008-09-26 14:19:52 +0000
committered <ed@FreeBSD.org>2008-09-26 14:19:52 +0000
commit4212d51a7da942b0c717c9965552c9549d90de08 (patch)
treef45f750affeffb39e162226343b0db9a110c42ce /sys/net/if_tun.c
parent0a873f95fe4b1e8d5d3f6ead357fca828948b3ac (diff)
downloadFreeBSD-src-4212d51a7da942b0c717c9965552c9549d90de08.zip
FreeBSD-src-4212d51a7da942b0c717c9965552c9549d90de08.tar.gz
Remove unit2minor() use from kernel code.
When I changed kern_conf.c three months ago I made device unit numbers equal to (unneeded) device minor numbers. We used to require bitshifting, because there were eight bits in the middle that were reserved for a device major number. Not very long after I turned dev2unit(), minor(), unit2minor() and minor2unit() into macro's. The unit2minor() and minor2unit() macro's were no-ops. We'd better not remove these four macro's from the kernel, because there is a lot of (external) code that may still depend on them. For now it's harmless to remove all invocations of unit2minor() and minor2unit(). Reviewed by: kib
Diffstat (limited to 'sys/net/if_tun.c')
-rw-r--r--sys/net/if_tun.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/net/if_tun.c b/sys/net/if_tun.c
index 6f6f05c..24f3187 100644
--- a/sys/net/if_tun.c
+++ b/sys/net/if_tun.c
@@ -183,7 +183,7 @@ tun_clone_create(struct if_clone *ifc, int unit, caddr_t params)
i = clone_create(&tunclones, &tun_cdevsw, &unit, &dev, 0);
if (i) {
/* No preexisting struct cdev *, create one */
- dev = make_dev(&tun_cdevsw, unit2minor(unit),
+ dev = make_dev(&tun_cdevsw, unit,
UID_UUCP, GID_DIALER, 0600, "%s%d", ifc->ifc_name, unit);
if (dev != NULL) {
dev_ref(dev);
@@ -233,7 +233,7 @@ tunclone(void *arg, struct ucred *cred, char *name, int namelen,
name = devname;
}
/* No preexisting struct cdev *, create one */
- *dev = make_dev(&tun_cdevsw, unit2minor(u),
+ *dev = make_dev(&tun_cdevsw, u,
UID_UUCP, GID_DIALER, 0600, "%s", name);
if (*dev != NULL) {
dev_ref(*dev);
OpenPOWER on IntegriCloud