Module Name:    src
Committed By:   pooka
Date:           Sun Jan  4 19:24:11 UTC 2015

Modified Files:
        src/sys/dev: firmload.c

Log Message:
malloc -> kmem_alloc


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/dev/firmload.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/dev/firmload.c
diff -u src/sys/dev/firmload.c:1.19 src/sys/dev/firmload.c:1.20
--- src/sys/dev/firmload.c:1.19	Tue Mar 25 16:19:13 2014
+++ src/sys/dev/firmload.c	Sun Jan  4 19:24:11 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: firmload.c,v 1.19 2014/03/25 16:19:13 christos Exp $	*/
+/*	$NetBSD: firmload.c,v 1.20 2015/01/04 19:24:11 pooka Exp $	*/
 
 /*-
  * Copyright (c) 2005, 2006 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: firmload.c,v 1.19 2014/03/25 16:19:13 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: firmload.c,v 1.20 2015/01/04 19:24:11 pooka Exp $");
 
 /*
  * The firmload API provides an interface for device drivers to access
@@ -40,7 +40,7 @@ __KERNEL_RCSID(0, "$NetBSD: firmload.c,v
 #include <sys/param.h>
 #include <sys/fcntl.h>
 #include <sys/filedesc.h>
-#include <sys/malloc.h>
+#include <sys/kmem.h>
 #include <sys/namei.h>
 #include <sys/systm.h>
 #include <sys/sysctl.h>
@@ -50,8 +50,6 @@ __KERNEL_RCSID(0, "$NetBSD: firmload.c,v
 
 #include <dev/firmload.h>
 
-MALLOC_DEFINE(M_DEVFIRM, "devfirm", "device firmware buffers");
-
 struct firmware_handle {
 	struct vnode	*fh_vp;
 	off_t		 fh_size;
@@ -61,14 +59,14 @@ static firmware_handle_t
 firmware_handle_alloc(void)
 {
 
-	return (malloc(sizeof(struct firmware_handle), M_DEVFIRM, M_WAITOK));
+	return (kmem_alloc(sizeof(struct firmware_handle), KM_SLEEP));
 }
 
 static void
 firmware_handle_free(firmware_handle_t fh)
 {
 
-	free(fh, M_DEVFIRM);
+	kmem_free(fh, sizeof(*fh));
 }
 
 #if !defined(FIRMWARE_PATHS)
@@ -336,7 +334,7 @@ void *
 firmware_malloc(size_t size)
 {
 
-	return (malloc(size, M_DEVFIRM, M_WAITOK));
+	return (kmem_alloc(size, KM_SLEEP));
 }
 
 /*
@@ -349,5 +347,5 @@ void
 firmware_free(void *v, size_t size)
 {
 
-	free(v, M_DEVFIRM);
+	kmem_free(v, size);
 }

Reply via email to