From f5461d41b129fefc48ff4c9ded82554394de9bf0 Mon Sep 17 00:00:00 2001 From: Kenneth R Westerback Date: Sat, 6 Oct 2007 23:50:56 +0000 Subject: Simpliest memset(,0,) -> M_ZERO changes. One (caddr *) cast removal, otherwise just adding M_ZERO to malloc() and removing the immediately adjacent memset(,0,). --- sys/arch/arm/arm/mem.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'sys/arch/arm') diff --git a/sys/arch/arm/arm/mem.c b/sys/arch/arm/arm/mem.c index 8375052531f..bcf8367e212 100644 --- a/sys/arch/arm/arm/mem.c +++ b/sys/arch/arm/arm/mem.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mem.c,v 1.6 2006/11/29 13:28:45 miod Exp $ */ +/* $OpenBSD: mem.c,v 1.7 2007/10/06 23:50:54 krw Exp $ */ /* $NetBSD: mem.c,v 1.11 2003/10/16 12:02:58 jdolecek Exp $ */ /* @@ -215,11 +215,9 @@ mmrw(dev, uio, flags) uio->uio_resid = 0; return (0); } - if (zeropage == NULL) { - zeropage = (caddr_t) - malloc(PAGE_SIZE, M_TEMP, M_WAITOK); - memset(zeropage, 0, PAGE_SIZE); - } + if (zeropage == NULL) + zeropage = malloc(PAGE_SIZE, M_TEMP, + M_WAITOK | M_ZERO); c = min(iov->iov_len, PAGE_SIZE); error = uiomove(zeropage, c, uio); break; -- cgit v1.2.3