Module Name: src
Committed By: thorpej
Date: Sat Nov 21 21:08:33 UTC 2020
Modified Files:
src/sys/arch/hpc/hpc: config_hook.c
Log Message:
malloc(9) -> kmem(9)
To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/hpc/hpc/config_hook.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/hpc/hpc/config_hook.c
diff -u src/sys/arch/hpc/hpc/config_hook.c:1.11 src/sys/arch/hpc/hpc/config_hook.c:1.12
--- src/sys/arch/hpc/hpc/config_hook.c:1.11 Sun Nov 10 21:16:27 2019
+++ src/sys/arch/hpc/hpc/config_hook.c Sat Nov 21 21:08:32 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: config_hook.c,v 1.11 2019/11/10 21:16:27 chs Exp $ */
+/* $NetBSD: config_hook.c,v 1.12 2020/11/21 21:08:32 thorpej Exp $ */
/*-
* Copyright (c) 1999-2001
@@ -35,11 +35,11 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: config_hook.c,v 1.11 2019/11/10 21:16:27 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: config_hook.c,v 1.12 2020/11/21 21:08:32 thorpej Exp $");
#include <sys/param.h>
#include <sys/device.h>
-#include <sys/malloc.h>
+#include <sys/kmem.h>
#include <sys/systm.h>
#include <sys/kernel.h>
@@ -118,7 +118,7 @@ config_hook(int type, long id, enum conf
}
/* allocate new record */
- hr = malloc(sizeof(*hr), M_DEVBUF, M_WAITOK);
+ hr = kmem_alloc(sizeof(*hr), KM_SLEEP);
hr->hr_ctx = ctx;
hr->hr_type = type;
hr->hr_id = id;
@@ -165,7 +165,7 @@ config_unhook(config_hook_tag hrx)
}
splx(s);
}
- free(hr, M_DEVBUF);
+ kmem_free(hr, sizeof(*hr));
}
int
@@ -208,7 +208,7 @@ config_connect(int type, long id)
}
/* allocate new record */
- cr = malloc(sizeof(*hr), M_DEVBUF, M_WAITOK);
+ cr = kmem_alloc(sizeof(*hr), KM_SLEEP);
cr->hr_func = NULL;
cr->hr_type = type;
cr->hr_id = id;
@@ -243,7 +243,7 @@ config_disconnect(config_call_tag crx)
TAILQ_REMOVE(&call_list, cr, hr_link);
splx(s);
- free(cr, M_DEVBUF);
+ kmem_free(cr, sizeof(*cr));
}
int