Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/mips/rmi Use M_ZERO with malloc instead of doing a ...



details:   https://anonhg.NetBSD.org/src/rev/d0c4801b179a
branches:  trunk
changeset: 764639:d0c4801b179a
user:      matt <matt%NetBSD.org@localhost>
date:      Fri Apr 29 21:59:09 2011 +0000

description:
Use M_ZERO with malloc instead of doing a explicit memset

diffstat:

 sys/arch/mips/rmi/rmixl_pcix.c |  8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diffs (36 lines):

diff -r a326eb01299d -r d0c4801b179a sys/arch/mips/rmi/rmixl_pcix.c
--- a/sys/arch/mips/rmi/rmixl_pcix.c    Fri Apr 29 21:58:27 2011 +0000
+++ b/sys/arch/mips/rmi/rmixl_pcix.c    Fri Apr 29 21:59:09 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rmixl_pcix.c,v 1.5 2011/04/14 05:22:47 cliff Exp $     */
+/*     $NetBSD: rmixl_pcix.c,v 1.6 2011/04/29 21:59:09 matt Exp $      */
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rmixl_pcix.c,v 1.5 2011/04/14 05:22:47 cliff Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rmixl_pcix.c,v 1.6 2011/04/29 21:59:09 matt Exp $");
 
 #include "opt_pci.h"
 #include "pci.h"
@@ -983,7 +983,7 @@
         * allocate and initialize softc intr struct
         * with one or more dispatch handles
         */
-       pip_new = malloc(size, M_DEVBUF, M_NOWAIT);
+       pip_new = malloc(size, M_DEVBUF, M_NOWAIT|M_ZERO);
        if (pip_new == NULL) {
 #ifdef DIAGNOSTIC
                printf("%s: cannot malloc\n", __func__);
@@ -991,8 +991,6 @@
                return NULL;
        }
 
-       memset(pip_new, 0, size);
-
        if (pip_old == NULL) {
                /* initialize the interrupt struct */
                pip_new->sc = sc;



Home | Main Index | Thread Index | Old Index