Module Name:    src
Committed By:   thorpej
Date:           Sat Nov 21 21:25:34 UTC 2020

Modified Files:
        src/sys/arch/hpcarm/dev: wzero3_kbd.c
        src/sys/arch/hpcarm/hpcarm: softintr.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/hpcarm/dev/wzero3_kbd.c
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/hpcarm/hpcarm/softintr.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/hpcarm/dev/wzero3_kbd.c
diff -u src/sys/arch/hpcarm/dev/wzero3_kbd.c:1.9 src/sys/arch/hpcarm/dev/wzero3_kbd.c:1.10
--- src/sys/arch/hpcarm/dev/wzero3_kbd.c:1.9	Sun Nov 10 21:16:27 2019
+++ src/sys/arch/hpcarm/dev/wzero3_kbd.c	Sat Nov 21 21:25:33 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: wzero3_kbd.c,v 1.9 2019/11/10 21:16:27 chs Exp $	*/
+/*	$NetBSD: wzero3_kbd.c,v 1.10 2020/11/21 21:25:33 thorpej Exp $	*/
 
 /*-
  * Copyright (C) 2008, 2009, 2010 NONAKA Kimihiro <[email protected]>
@@ -26,13 +26,13 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wzero3_kbd.c,v 1.9 2019/11/10 21:16:27 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wzero3_kbd.c,v 1.10 2020/11/21 21:25:33 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/device.h>
 #include <sys/kernel.h>
-#include <sys/malloc.h>
+#include <sys/kmem.h>
 #include <sys/callout.h>
 #include <sys/bus.h>
 
@@ -288,10 +288,8 @@ wzero3kbd_attach(device_t parent, device
 		return;
 	}
 
-	sc->sc_okeystat = malloc(sc->sc_nrow * sc->sc_ncolumn, M_DEVBUF,
-	    M_WAITOK | M_ZERO);
-	sc->sc_keystat = malloc(sc->sc_nrow * sc->sc_ncolumn, M_DEVBUF,
-	    M_WAITOK | M_ZERO);
+	sc->sc_okeystat = kmem_zalloc(sc->sc_nrow * sc->sc_ncolumn, KM_SLEEP);
+	sc->sc_keystat = kmem_zalloc(sc->sc_nrow * sc->sc_ncolumn, KM_SLEEP);
 
 	sc->sc_if.hii_ctx = sc;
 	sc->sc_if.hii_establish = wzero3kbd_input_establish;

Index: src/sys/arch/hpcarm/hpcarm/softintr.c
diff -u src/sys/arch/hpcarm/hpcarm/softintr.c:1.16 src/sys/arch/hpcarm/hpcarm/softintr.c:1.17
--- src/sys/arch/hpcarm/hpcarm/softintr.c:1.16	Sun Nov 10 21:16:27 2019
+++ src/sys/arch/hpcarm/hpcarm/softintr.c	Sat Nov 21 21:25:33 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: softintr.c,v 1.16 2019/11/10 21:16:27 chs Exp $	*/
+/*	$NetBSD: softintr.c,v 1.17 2020/11/21 21:25:33 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,12 +30,12 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: softintr.c,v 1.16 2019/11/10 21:16:27 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: softintr.c,v 1.17 2020/11/21 21:25:33 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/syslog.h>
-#include <sys/malloc.h>
+#include <sys/kmem.h>
 
 #include <machine/cpu.h>
 #include <arm/cpufunc.h>
@@ -63,7 +63,7 @@ softintr_establish(int level, void (*fun
 {
 	struct softintr_handler *sh;
 
-	sh = malloc(sizeof(*sh), M_DEVBUF, M_WAITOK);
+	sh = kmem_alloc(sizeof(*sh), KM_SLEEP);
 	sh->sh_fun = fun;
 	sh->sh_level = ipl_to_spl(level);
 	sh->sh_arg = arg;
@@ -85,15 +85,16 @@ softintr_disestablish(void *cookie)
 		SetCPSR(I32_bit, I32_bit & saved_cpsr);
 	} else {
 		SetCPSR(I32_bit, I32_bit & saved_cpsr);
-		free(sh, M_DEVBUF);
+		kmem_free(sh, sizeof(*sh));
 	}
 }
 
 void
 softintr_free(void *arg)
 {
+	struct softintr_handler *sh = arg;
 
-	free(arg, M_DEVBUF);
+	free(sh, sizeof(*sh));
 }
 
 void

Reply via email to