Module Name: src
Committed By: thorpej
Date: Fri Nov 20 17:38:05 UTC 2020
Modified Files:
src/sys/arch/acorn32/mainbus: fd.c
src/sys/arch/acorn32/podulebus: podulebus.c
Log Message:
malloc(9) -> kmem(9)
To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/sys/arch/acorn32/mainbus/fd.c
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/acorn32/podulebus/podulebus.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/acorn32/mainbus/fd.c
diff -u src/sys/arch/acorn32/mainbus/fd.c:1.61 src/sys/arch/acorn32/mainbus/fd.c:1.62
--- src/sys/arch/acorn32/mainbus/fd.c:1.61 Sun Nov 10 21:16:21 2019
+++ src/sys/arch/acorn32/mainbus/fd.c Fri Nov 20 17:38:05 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: fd.c,v 1.61 2019/11/10 21:16:21 chs Exp $ */
+/* $NetBSD: fd.c,v 1.62 2020/11/20 17:38:05 thorpej Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -82,7 +82,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.61 2019/11/10 21:16:21 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.62 2020/11/20 17:38:05 thorpej Exp $");
#include "opt_ddb.h"
@@ -97,7 +97,7 @@ __KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.61
#include <sys/disk.h>
#include <sys/buf.h>
#include <sys/bufq.h>
-#include <sys/malloc.h>
+#include <sys/kmem.h>
#include <sys/uio.h>
#include <sys/syslog.h>
#include <sys/queue.h>
@@ -1397,8 +1397,7 @@ fdioctl(dev_t dev, u_long cmd, void *add
return EINVAL;
}
- fd_formb = malloc(sizeof(struct ne7_fd_formb),
- M_TEMP, M_WAITOK);
+ fd_formb = kmem_alloc(sizeof(*fd_formb), KM_SLEEP);
fd_formb->head = form_cmd->head;
fd_formb->cyl = form_cmd->cylinder;
fd_formb->transfer_rate = fd->sc_type->rate;
@@ -1422,7 +1421,7 @@ fdioctl(dev_t dev, u_long cmd, void *add
}
error = fdformat(dev, fd_formb, l);
- free(fd_formb, M_TEMP);
+ kmem_free(fd_formb, sizeof(*fd_formb));
return error;
case FDIOCGETOPTS: /* get drive options */
Index: src/sys/arch/acorn32/podulebus/podulebus.c
diff -u src/sys/arch/acorn32/podulebus/podulebus.c:1.29 src/sys/arch/acorn32/podulebus/podulebus.c:1.30
--- src/sys/arch/acorn32/podulebus/podulebus.c:1.29 Sat Oct 25 10:58:12 2014
+++ src/sys/arch/acorn32/podulebus/podulebus.c Fri Nov 20 17:38:05 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: podulebus.c,v 1.29 2014/10/25 10:58:12 skrll Exp $ */
+/* $NetBSD: podulebus.c,v 1.30 2020/11/20 17:38:05 thorpej Exp $ */
/*
* Copyright (c) 1994-1996 Mark Brinicombe.
@@ -43,12 +43,12 @@
#include <sys/param.h>
-__KERNEL_RCSID(0, "$NetBSD: podulebus.c,v 1.29 2014/10/25 10:58:12 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: podulebus.c,v 1.30 2020/11/20 17:38:05 thorpej Exp $");
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/conf.h>
-#include <sys/malloc.h>
+#include <sys/kmem.h>
#include <sys/device.h>
#include <uvm/uvm_extern.h>
#include <machine/io.h>
@@ -561,7 +561,7 @@ podulebus_shift_tag(bus_space_tag_t tag,
*/
/* XXX never freed, but podules are never detached anyway. */
- *tagp = malloc(sizeof(struct bus_space), M_DEVBUF, M_WAITOK);
+ *tagp = kmem_alloc(sizeof(struct bus_space), KM_SLEEP);
**tagp = *tag;
(*tagp)->bs_cookie = (void *)shift;
}