Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/arc Use M_ZERO flag for malloc(9) and remove bzero(9).
details: https://anonhg.NetBSD.org/src/rev/404f9718d83d
branches: trunk
changeset: 573213:404f9718d83d
user: tsutsui <tsutsui%NetBSD.org@localhost>
date: Sat Jan 22 07:44:08 2005 +0000
description:
Use M_ZERO flag for malloc(9) and remove bzero(9).
diffstat:
sys/arch/arc/arc/bus_dma.c | 7 +++----
sys/arch/arc/jazz/pckbc_jazzio.c | 8 ++++----
2 files changed, 7 insertions(+), 8 deletions(-)
diffs (59 lines):
diff -r 4823a14e0a3f -r 404f9718d83d sys/arch/arc/arc/bus_dma.c
--- a/sys/arch/arc/arc/bus_dma.c Sat Jan 22 07:35:33 2005 +0000
+++ b/sys/arch/arc/arc/bus_dma.c Sat Jan 22 07:44:08 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bus_dma.c,v 1.20 2005/01/22 07:35:33 tsutsui Exp $ */
+/* $NetBSD: bus_dma.c,v 1.21 2005/01/22 07:44:08 tsutsui Exp $ */
/* NetBSD: bus_dma.c,v 1.20 2000/01/10 03:24:36 simonb Exp */
/*-
@@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.20 2005/01/22 07:35:33 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.21 2005/01/22 07:44:08 tsutsui Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -110,10 +110,9 @@
mapsize = sizeof(struct arc_bus_dmamap) +
(sizeof(bus_dma_segment_t) * (nsegments - 1));
if ((mapstore = malloc(mapsize, M_DMAMAP,
- (flags & BUS_DMA_NOWAIT) ? M_NOWAIT : M_WAITOK)) == NULL)
+ ((flags & BUS_DMA_NOWAIT) ? M_NOWAIT : M_WAITOK) | M_ZERO)) == NULL)
return ENOMEM;
- bzero(mapstore, mapsize);
map = (struct arc_bus_dmamap *)mapstore;
map->_dm_size = size;
map->_dm_segcnt = nsegments;
diff -r 4823a14e0a3f -r 404f9718d83d sys/arch/arc/jazz/pckbc_jazzio.c
--- a/sys/arch/arc/jazz/pckbc_jazzio.c Sat Jan 22 07:35:33 2005 +0000
+++ b/sys/arch/arc/jazz/pckbc_jazzio.c Sat Jan 22 07:44:08 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pckbc_jazzio.c,v 1.12 2005/01/22 07:35:34 tsutsui Exp $ */
+/* $NetBSD: pckbc_jazzio.c,v 1.13 2005/01/22 07:44:08 tsutsui Exp $ */
/* NetBSD: pckbc_isa.c,v 1.2 2000/03/23 07:01:35 thorpej Exp */
/*
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pckbc_jazzio.c,v 1.12 2005/01/22 07:35:34 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pckbc_jazzio.c,v 1.13 2005/01/22 07:44:08 tsutsui Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -147,8 +147,8 @@
bus_space_map(iot, PICA_KBCMDP, 1, 0, &ioh_c))
panic("pckbc_attach: couldn't map");
- t = malloc(sizeof(struct pckbc_internal), M_DEVBUF, M_WAITOK);
- bzero(t, sizeof(struct pckbc_internal));
+ t = malloc(sizeof(struct pckbc_internal), M_DEVBUF,
+ M_WAITOK | M_ZERO);
t->t_iot = iot;
t->t_ioh_d = ioh_d;
t->t_ioh_c = ioh_c;
Home |
Main Index |
Thread Index |
Old Index