From 78ba29b05a4d0e04205a6247ac5d473b93917a7d Mon Sep 17 00:00:00 2001 From: nakayama Date: Fri, 13 May 2016 21:22:47 +0000 Subject: [PATCH] Use newly introduced intrhand_alloc(). --- sys/arch/sparc64/dev/ebus_mainbus.c | 8 +++----- sys/arch/sparc64/sparc64/machdep.c | 10 +++------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/sys/arch/sparc64/dev/ebus_mainbus.c b/sys/arch/sparc64/dev/ebus_mainbus.c index 9f887eb806b7..c277f7b03140 100644 --- a/sys/arch/sparc64/dev/ebus_mainbus.c +++ b/sys/arch/sparc64/dev/ebus_mainbus.c @@ -1,4 +1,4 @@ -/* $NetBSD: ebus_mainbus.c,v 1.15 2014/11/04 18:11:42 palle Exp $ */ +/* $NetBSD: ebus_mainbus.c,v 1.16 2016/05/13 21:22:47 nakayama Exp $ */ /* $OpenBSD: ebus_mainbus.c,v 1.7 2010/11/11 17:58:23 miod Exp $ */ /* @@ -18,7 +18,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ebus_mainbus.c,v 1.15 2014/11/04 18:11:42 palle Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ebus_mainbus.c,v 1.16 2016/05/13 21:22:47 nakayama Exp $"); #ifdef DEBUG #define EDB_PROM 0x01 @@ -350,9 +350,7 @@ XXX intrclrptr = &iclr[ino]; ino |= INTVEC(ihandle); - ih = malloc(sizeof *ih, M_DEVBUF, M_NOWAIT); - if (ih == NULL) - return (NULL); + ih = intrhand_alloc(); /* Register the map and clear intr registers */ ih->ih_map = intrmapptr; diff --git a/sys/arch/sparc64/sparc64/machdep.c b/sys/arch/sparc64/sparc64/machdep.c index 4af602687066..db21054786c4 100644 --- a/sys/arch/sparc64/sparc64/machdep.c +++ b/sys/arch/sparc64/sparc64/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.283 2015/11/22 09:32:34 martin Exp $ */ +/* $NetBSD: machdep.c,v 1.284 2016/05/13 21:22:47 nakayama Exp $ */ /*- * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc. @@ -71,7 +71,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.283 2015/11/22 09:32:34 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.284 2016/05/13 21:22:47 nakayama Exp $"); #include "opt_ddb.h" #include "opt_multiprocessor.h" @@ -2368,11 +2368,7 @@ sparc_mainbus_intr_establish(bus_space_tag_t t, int pil, int level, { struct intrhand *ih; - ih = (struct intrhand *) - malloc(sizeof(struct intrhand), M_DEVBUF, M_NOWAIT); - if (ih == NULL) - return (NULL); - + ih = intrhand_alloc(); ih->ih_fun = handler; ih->ih_arg = arg; intr_establish(pil, level != IPL_VM, ih);