svn commit: r191118 - head/sys/kern
Ed Schouten
ed at FreeBSD.org
Wed Apr 15 20:43:13 UTC 2009
Author: ed
Date: Wed Apr 15 20:43:12 2009
New Revision: 191118
URL: http://svn.freebsd.org/changeset/base/191118
Log:
Remove dead code from devtoname().
In the good old days it was possible to have dev_t's that referred to
nonexistent devices. In these cases devtoname() automatically generated
names. This is no longer possible, so remove this dead code.
Discussed with: kib
Modified:
head/sys/kern/kern_conf.c
Modified: head/sys/kern/kern_conf.c
==============================================================================
--- head/sys/kern/kern_conf.c Wed Apr 15 20:34:19 2009 (r191117)
+++ head/sys/kern/kern_conf.c Wed Apr 15 20:43:12 2009 (r191118)
@@ -859,24 +859,7 @@ destroy_dev(struct cdev *dev)
const char *
devtoname(struct cdev *dev)
{
- char *p;
- struct cdevsw *csw;
- int mynor;
-
- if (dev->si_name[0] == '#' || dev->si_name[0] == '\0') {
- p = dev->si_name;
- csw = dev_refthread(dev);
- if (csw != NULL) {
- sprintf(p, "(%s)", csw->d_name);
- dev_relthread(dev);
- }
- p += strlen(p);
- mynor = dev2unit(dev);
- if (mynor < 0 || mynor > 255)
- sprintf(p, "/%#x", (u_int)mynor);
- else
- sprintf(p, "/%d", mynor);
- }
+
return (dev->si_name);
}
More information about the svn-src-all
mailing list