Date: Wed, 15 Apr 2009 20:15:36 +0000 (UTC) From: Ed Schouten <ed@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r191116 - head/sys/kern Message-ID: <200904152015.n3FKFaax053439@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ed Date: Wed Apr 15 20:15:36 2009 New Revision: 191116 URL: http://svn.freebsd.org/changeset/base/191116 Log: 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(). Modified: head/sys/kern/kern_conf.c Modified: head/sys/kern/kern_conf.c ============================================================================== --- head/sys/kern/kern_conf.c Wed Apr 15 20:08:26 2009 (r191115) +++ head/sys/kern/kern_conf.c Wed Apr 15 20:15:36 2009 (r191116) @@ -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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200904152015.n3FKFaax053439>