From 50fccdce5e1c4fc0fbe5b921d8d1fc2823474a7b Mon Sep 17 00:00:00 2001 From: bde Date: Tue, 24 Aug 1999 00:22:10 +0000 Subject: Fixed a misplaced cast to uintptr_t. Cosmetic. Use device_get_nameunit() instead of rolling our own. --- sys/amd64/amd64/legacy.c | 11 ++++------- sys/amd64/amd64/nexus.c | 11 ++++------- 2 files changed, 8 insertions(+), 14 deletions(-) (limited to 'sys/amd64') diff --git a/sys/amd64/amd64/legacy.c b/sys/amd64/amd64/legacy.c index 35b7cd6..0c28185 100644 --- a/sys/amd64/amd64/legacy.c +++ b/sys/amd64/amd64/legacy.c @@ -26,7 +26,7 @@ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: nexus.c,v 1.14 1999/08/22 19:56:55 peter Exp $ + * $Id: nexus.c,v 1.15 1999/08/23 19:23:33 peter Exp $ */ /* @@ -282,7 +282,7 @@ nexus_alloc_resource(device_t bus, device_t child, int type, int *rid, /* * The first 1Mb is mapped at KERNBASE. */ - vaddr = (caddr_t)((uintptr_t)KERNBASE + rv->r_start); + vaddr = (caddr_t)(uintptr_t)(KERNBASE + rv->r_start); } else { u_int32_t paddr; u_int32_t psize; @@ -351,7 +351,6 @@ nexus_setup_intr(device_t bus, device_t child, struct resource *irq, intrmask_t *mask; driver_t *driver; int error, icflags; - char name[32]; /* somebody tried to setup an irq that failed to allocate! */ if (irq == NULL) @@ -395,10 +394,8 @@ nexus_setup_intr(device_t bus, device_t child, struct resource *irq, if (error) return (error); - snprintf(name, sizeof(name), "%s%d", device_get_name(child), - device_get_unit(child)); - *cookiep = inthand_add(name, irq->r_start, ihand, arg, - mask, icflags); + *cookiep = inthand_add(device_get_nameunit(child), irq->r_start, + ihand, arg, mask, icflags); if (*cookiep == NULL) error = EINVAL; /* XXX ??? */ diff --git a/sys/amd64/amd64/nexus.c b/sys/amd64/amd64/nexus.c index 35b7cd6..0c28185 100644 --- a/sys/amd64/amd64/nexus.c +++ b/sys/amd64/amd64/nexus.c @@ -26,7 +26,7 @@ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: nexus.c,v 1.14 1999/08/22 19:56:55 peter Exp $ + * $Id: nexus.c,v 1.15 1999/08/23 19:23:33 peter Exp $ */ /* @@ -282,7 +282,7 @@ nexus_alloc_resource(device_t bus, device_t child, int type, int *rid, /* * The first 1Mb is mapped at KERNBASE. */ - vaddr = (caddr_t)((uintptr_t)KERNBASE + rv->r_start); + vaddr = (caddr_t)(uintptr_t)(KERNBASE + rv->r_start); } else { u_int32_t paddr; u_int32_t psize; @@ -351,7 +351,6 @@ nexus_setup_intr(device_t bus, device_t child, struct resource *irq, intrmask_t *mask; driver_t *driver; int error, icflags; - char name[32]; /* somebody tried to setup an irq that failed to allocate! */ if (irq == NULL) @@ -395,10 +394,8 @@ nexus_setup_intr(device_t bus, device_t child, struct resource *irq, if (error) return (error); - snprintf(name, sizeof(name), "%s%d", device_get_name(child), - device_get_unit(child)); - *cookiep = inthand_add(name, irq->r_start, ihand, arg, - mask, icflags); + *cookiep = inthand_add(device_get_nameunit(child), irq->r_start, + ihand, arg, mask, icflags); if (*cookiep == NULL) error = EINVAL; /* XXX ??? */ -- cgit v1.1