Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 Apr 2009 20:43:12 +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: r191118 - head/sys/kern
Message-ID:  <200904152043.n3FKhCVs054080@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200904152043.n3FKhCVs054080>