Module Name: src
Committed By: thorpej
Date: Fri Nov 20 18:16:40 UTC 2020
Modified Files:
src/sys/arch/arm/imx: imx51_ipuv3.c imxuart.c
Log Message:
malloc(9) -> kmem(9)
To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/arm/imx/imx51_ipuv3.c
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/arm/imx/imxuart.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/imx/imx51_ipuv3.c
diff -u src/sys/arch/arm/imx/imx51_ipuv3.c:1.8 src/sys/arch/arm/imx/imx51_ipuv3.c:1.9
--- src/sys/arch/arm/imx/imx51_ipuv3.c:1.8 Sun Nov 10 21:16:23 2019
+++ src/sys/arch/arm/imx/imx51_ipuv3.c Fri Nov 20 18:16:40 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: imx51_ipuv3.c,v 1.8 2019/11/10 21:16:23 chs Exp $ */
+/* $NetBSD: imx51_ipuv3.c,v 1.9 2020/11/20 18:16:40 thorpej Exp $ */
/*
* Copyright (c) 2011, 2012 Genetec Corporation. All rights reserved.
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: imx51_ipuv3.c,v 1.8 2019/11/10 21:16:23 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: imx51_ipuv3.c,v 1.9 2020/11/20 18:16:40 thorpej Exp $");
#include "opt_imx51_ipuv3.h"
@@ -35,7 +35,7 @@ __KERNEL_RCSID(0, "$NetBSD: imx51_ipuv3.
#include <sys/systm.h>
#include <sys/conf.h>
#include <sys/uio.h>
-#include <sys/malloc.h>
+#include <sys/kmem.h>
#include <sys/kernel.h> /* for cold */
#include <sys/bus.h>
@@ -932,7 +932,7 @@ imx51_ipuv3_new_screen(struct imx51_ipuv
width = geometry->panel_width;
height = geometry->panel_height;
- scr = malloc(sizeof(*scr), M_DEVBUF, M_WAITOK | M_ZERO);
+ scr = kmem_zalloc(sizeof(*scr), KM_SLEEP);
scr->nsegs = 0;
scr->depth = depth;
scr->stride = width * depth / 8;
@@ -944,7 +944,7 @@ imx51_ipuv3_new_screen(struct imx51_ipuv
aprint_error_dev(sc->dev,
"failed to allocate %u bytes of video memory: %d\n",
scr->stride * height, error);
- free(scr, M_DEVBUF);
+ kmem_free(scr, sizeof(*scr));
return error;
}
Index: src/sys/arch/arm/imx/imxuart.c
diff -u src/sys/arch/arm/imx/imxuart.c:1.25 src/sys/arch/arm/imx/imxuart.c:1.26
--- src/sys/arch/arm/imx/imxuart.c:1.25 Wed May 20 09:18:25 2020
+++ src/sys/arch/arm/imx/imxuart.c Fri Nov 20 18:16:40 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: imxuart.c,v 1.25 2020/05/20 09:18:25 hkenken Exp $ */
+/* $NetBSD: imxuart.c,v 1.26 2020/11/20 18:16:40 thorpej Exp $ */
/*
* Copyright (c) 2009, 2010 Genetec Corporation. All rights reserved.
@@ -96,7 +96,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: imxuart.c,v 1.25 2020/05/20 09:18:25 hkenken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: imxuart.c,v 1.26 2020/11/20 18:16:40 thorpej Exp $");
#include "opt_imxuart.h"
#include "opt_ddb.h"
@@ -148,7 +148,7 @@ __KERNEL_RCSID(0, "$NetBSD: imxuart.c,v
#include <sys/kernel.h>
#include <sys/syslog.h>
#include <sys/device.h>
-#include <sys/malloc.h>
+#include <sys/kmem.h>
#include <sys/timepps.h>
#include <sys/vnode.h>
#include <sys/kauth.h>
@@ -354,8 +354,8 @@ imxuart_attach_subr(struct imxuart_softc
tp->t_hwiflow = imxuhwiflow;
sc->sc_tty = tp;
- sc->sc_rbuf = malloc(sizeof (*sc->sc_rbuf) * imxuart_rbuf_size,
- M_DEVBUF, M_WAITOK);
+ sc->sc_rbuf = kmem_alloc(sizeof (*sc->sc_rbuf) * imxuart_rbuf_size,
+ KM_SLEEP);
sc->sc_rbuf_size = imxuart_rbuf_size;
sc->sc_rbuf_in = sc->sc_rbuf_out = 0;
sc->sc_txfifo_len = 32;
@@ -542,7 +542,7 @@ imxuart_detach(device_t self, int flags)
}
/* Free the receive buffer. */
- free(sc->sc_rbuf, M_DEVBUF);
+ kmem_free(sc->sc_rbuf, sizeof(*sc->sc_rbuf) * sc->sc_rbuf_size);
/* Detach and free the tty. */
tty_detach(sc->sc_tty);