diff options
author | ed <ed@FreeBSD.org> | 2009-04-15 20:15:36 +0000 |
---|---|---|
committer | ed <ed@FreeBSD.org> | 2009-04-15 20:15:36 +0000 |
commit | 46ae43e7c6d9bf27aa68fc70d5cc810041078537 (patch) | |
tree | bba066eef4e718c4a5771437244a3d64f0dd4f87 /sys | |
parent | 6df1ef4d2f3daa27007f53a51fdec947db687b69 (diff) | |
download | FreeBSD-src-46ae43e7c6d9bf27aa68fc70d5cc810041078537.zip FreeBSD-src-46ae43e7c6d9bf27aa68fc70d5cc810041078537.tar.gz |
Remove unneeded variable and casting from newdev().
Remove the `udev' variable, which has a different type than the original
function argument and si_drv0. The `udev' name is also misleading,
because it is not the number returned by dev2udev(). Rename this
argument to `unit'. It is the same number as returned by dev2unit().
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/kern_conf.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/sys/kern/kern_conf.c b/sys/kern/kern_conf.c index c5223d8..7343daa 100644 --- a/sys/kern/kern_conf.c +++ b/sys/kern/kern_conf.c @@ -513,23 +513,21 @@ notify_destroy(struct cdev *dev) } static struct cdev * -newdev(struct cdevsw *csw, int y, struct cdev *si) +newdev(struct cdevsw *csw, int unit, struct cdev *si) { struct cdev *si2; - dev_t udev; mtx_assert(&devmtx, MA_OWNED); - udev = y; if (csw->d_flags & D_NEEDMINOR) { /* We may want to return an existing device */ LIST_FOREACH(si2, &csw->d_devs, si_list) { - if (dev2unit(si2) == udev) { + if (dev2unit(si2) == unit) { dev_free_devlocked(si); return (si2); } } } - si->si_drv0 = udev; + si->si_drv0 = unit; si->si_devsw = csw; LIST_INSERT_HEAD(&csw->d_devs, si, si_list); return (si); |