svn commit: r216070 - head/sys/kern
Warner Losh
imp at FreeBSD.org
Tue Nov 30 05:54:22 UTC 2010
Author: imp
Date: Tue Nov 30 05:54:21 2010
New Revision: 216070
URL: http://svn.freebsd.org/changeset/base/216070
Log:
Remove redundant (and bogus) insertion of pnp info when announcing new
and retiring devices. That's already inserted elsewhere.
Submitted by: n_hibma
MFC after: 3 days
Modified:
head/sys/kern/subr_bus.c
Modified: head/sys/kern/subr_bus.c
==============================================================================
--- head/sys/kern/subr_bus.c Tue Nov 30 01:27:54 2010 (r216069)
+++ head/sys/kern/subr_bus.c Tue Nov 30 05:54:21 2010 (r216070)
@@ -708,25 +708,7 @@ bad:
static void
devadded(device_t dev)
{
- char *pnp = NULL;
- char *tmp = NULL;
-
- pnp = malloc(1024, M_BUS, M_NOWAIT);
- if (pnp == NULL)
- goto fail;
- tmp = malloc(1024, M_BUS, M_NOWAIT);
- if (tmp == NULL)
- goto fail;
- *pnp = '\0';
- bus_child_pnpinfo_str(dev, pnp, 1024);
- snprintf(tmp, 1024, "%s %s", device_get_nameunit(dev), pnp);
- devaddq("+", tmp, dev);
-fail:
- if (pnp != NULL)
- free(pnp, M_BUS);
- if (tmp != NULL)
- free(tmp, M_BUS);
- return;
+ devaddq("+", device_get_nameunit(dev), dev);
}
/*
@@ -736,24 +718,7 @@ fail:
static void
devremoved(device_t dev)
{
- char *pnp = NULL;
- char *tmp = NULL;
-
- pnp = malloc(1024, M_BUS, M_NOWAIT);
- if (pnp == NULL)
- goto fail;
- tmp = malloc(1024, M_BUS, M_NOWAIT);
- if (tmp == NULL)
- goto fail;
- *pnp = '\0';
- bus_child_pnpinfo_str(dev, pnp, 1024);
- snprintf(tmp, 1024, "%s %s", device_get_nameunit(dev), pnp);
- devaddq("-", tmp, dev);
-fail:
- if (pnp != NULL)
- free(pnp, M_BUS);
- if (tmp != NULL)
- free(tmp, M_BUS);
+ devaddq("+", device_get_nameunit(dev), dev);
return;
}
More information about the svn-src-head
mailing list