Module Name:    src
Committed By:   thorpej
Date:           Fri Nov 20 18:18:51 UTC 2020

Modified Files:
        src/sys/arch/arm/iomd: iomd_irqhandler.c iomdkbc.c

Log Message:
malloc(9) -> kmem(9)


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/arm/iomd/iomd_irqhandler.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/iomd/iomdkbc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/iomd/iomd_irqhandler.c
diff -u src/sys/arch/arm/iomd/iomd_irqhandler.c:1.23 src/sys/arch/arm/iomd/iomd_irqhandler.c:1.24
--- src/sys/arch/arm/iomd/iomd_irqhandler.c:1.23	Sun Nov 10 21:16:23 2019
+++ src/sys/arch/arm/iomd/iomd_irqhandler.c	Fri Nov 20 18:18:51 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: iomd_irqhandler.c,v 1.23 2019/11/10 21:16:23 chs Exp $	*/
+/*	$NetBSD: iomd_irqhandler.c,v 1.24 2020/11/20 18:18:51 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1994-1998 Mark Brinicombe.
@@ -40,14 +40,14 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: iomd_irqhandler.c,v 1.23 2019/11/10 21:16:23 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: iomd_irqhandler.c,v 1.24 2020/11/20 18:18:51 thorpej Exp $");
 
 #include "opt_irqstats.h"
 
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/syslog.h>
-#include <sys/malloc.h>
+#include <sys/kmem.h>
 
 #include <arm/cpufunc.h>
 #include <arm/iomd/iomdreg.h>
@@ -346,7 +346,7 @@ intr_claim(int irq, int level, const cha
 {
 	irqhandler_t *ih;
 
-	ih = malloc(sizeof(*ih), M_DEVBUF, M_WAITOK);
+	ih = kmem_alloc(sizeof(*ih), KM_SLEEP);
 	ih->ih_level = level;
 	ih->ih_name = name;
 	ih->ih_func = ih_func;
@@ -354,7 +354,7 @@ intr_claim(int irq, int level, const cha
 	ih->ih_flags = 0;
 
 	if (irq_claim(irq, ih) != 0) {
-		free(ih, M_DEVBUF);
+		kmem_free(ih, sizeof(*ih));
 		return NULL;
 	}
 	return ih;
@@ -367,7 +367,7 @@ intr_release(void *arg)
 	irqhandler_t *ih = (irqhandler_t *)arg;
 
 	if (irq_release(ih->ih_num, ih) == 0) {
-		free(ih, M_DEVBUF);
+		kmem_free(ih, sizeof(*ih));
 		return 0 ;
 	}
 	return 1;

Index: src/sys/arch/arm/iomd/iomdkbc.c
diff -u src/sys/arch/arm/iomd/iomdkbc.c:1.6 src/sys/arch/arm/iomd/iomdkbc.c:1.7
--- src/sys/arch/arm/iomd/iomdkbc.c:1.6	Sun Nov 10 21:16:23 2019
+++ src/sys/arch/arm/iomd/iomdkbc.c	Fri Nov 20 18:18:51 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: iomdkbc.c,v 1.6 2019/11/10 21:16:23 chs Exp $ */
+/* $NetBSD: iomdkbc.c,v 1.7 2020/11/20 18:18:51 thorpej Exp $ */
 
 /*-
  * Copyright (c) 2004 Ben Harris
@@ -28,11 +28,11 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: iomdkbc.c,v 1.6 2019/11/10 21:16:23 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: iomdkbc.c,v 1.7 2020/11/20 18:18:51 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
-#include <sys/malloc.h>
+#include <sys/kmem.h>
 #include <sys/systm.h>
 
 #include <dev/pckbport/pckbportvar.h>
@@ -133,8 +133,8 @@ iomdkbc_attach(device_t parent, device_t
 			/* Have an iomdkbc as console.  Assume it's this one.*/
 			t = &iomdkbc_cntag;
 		} else {
-			t = malloc(sizeof(struct iomdkbc_internal), M_DEVBUF,
-			    M_WAITOK | M_ZERO);
+			t = kmem_zalloc(sizeof(struct iomdkbc_internal),
+			    KM_SLEEP);
 			t->t_haveport[PCKBPORT_KBD_SLOT] = 1;
 			t->t_iot = ka->ka_iot;
 			t->t_ioh[PCKBPORT_KBD_SLOT] = ka->ka_ioh;
@@ -151,8 +151,8 @@ iomdkbc_attach(device_t parent, device_t
 
 	if (strcmp(pa->pa_name, "opms") == 0) {
 		if (t == NULL) {
-			t = malloc(sizeof(struct iomdkbc_internal), M_DEVBUF,
-			    M_WAITOK | M_ZERO);
+			t = kmem_zalloc(sizeof(struct iomdkbc_internal),
+			    KM_SLEEP);
 		}
 		t->t_haveport[PCKBPORT_AUX_SLOT] = 1;
 		t->t_iot = pa->pa_iot;

Reply via email to