diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2007-09-17 01:33:34 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2007-09-17 01:33:34 +0000 |
commit | a854e6884a9635329a1490f5cf8420c8ab6f8f85 (patch) | |
tree | 29bd971e80c3ea6bf34f989e494141dcc2c006cb /sys/dev/pci | |
parent | 1dd97578d5974d04f8b171b17c36e35635acd61b (diff) |
Only the most obvious bzero() -> M_ZERO changes. No cast changes, no
MALLOC/FREE, etc. Just adding M_ZERO to malloc() and deleting an
immediately adjacent bzero().
Diffstat (limited to 'sys/dev/pci')
-rw-r--r-- | sys/dev/pci/agp.c | 8 | ||||
-rw-r--r-- | sys/dev/pci/agp_i810.c | 5 | ||||
-rw-r--r-- | sys/dev/pci/if_san_xilinx.c | 5 | ||||
-rw-r--r-- | sys/dev/pci/ips.c | 5 |
4 files changed, 9 insertions, 14 deletions
diff --git a/sys/dev/pci/agp.c b/sys/dev/pci/agp.c index 20147866804..52faa49e477 100644 --- a/sys/dev/pci/agp.c +++ b/sys/dev/pci/agp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: agp.c,v 1.6 2007/08/04 19:40:25 reyk Exp $ */ +/* $OpenBSD: agp.c,v 1.7 2007/09/17 01:33:33 krw Exp $ */ /*- * Copyright (c) 2000 Doug Rabson * All rights reserved. @@ -372,10 +372,9 @@ agp_alloc_gatt(struct vga_pci_softc *sc) struct agp_gatt *gatt; int nseg; - gatt = malloc(sizeof(*gatt), M_DEVBUF, M_NOWAIT); + gatt = malloc(sizeof(*gatt), M_DEVBUF, M_NOWAIT | M_ZERO); if (!gatt) return (NULL); - bzero(gatt, sizeof(*gatt)); gatt->ag_entries = entries; if (agp_alloc_dmamem(sc->sc_dmat, entries * sizeof(u_int32_t), @@ -474,10 +473,9 @@ agp_generic_alloc_memory(struct vga_pci_softc *sc, int type, vsize_t size) return 0; } - mem = malloc(sizeof *mem, M_DEVBUF, M_WAITOK); + mem = malloc(sizeof *mem, M_DEVBUF, M_WAITOK | M_ZERO); if (mem == NULL) return NULL; - bzero(mem, sizeof *mem); if (bus_dmamap_create(sc->sc_dmat, size, size / PAGE_SIZE + 1, size, 0, BUS_DMA_NOWAIT, &mem->am_dmamap) != 0) { diff --git a/sys/dev/pci/agp_i810.c b/sys/dev/pci/agp_i810.c index 916873b5a8c..d405e3d4e89 100644 --- a/sys/dev/pci/agp_i810.c +++ b/sys/dev/pci/agp_i810.c @@ -1,4 +1,4 @@ -/* $OpenBSD: agp_i810.c,v 1.15 2007/08/04 19:40:25 reyk Exp $ */ +/* $OpenBSD: agp_i810.c,v 1.16 2007/09/17 01:33:33 krw Exp $ */ /* $NetBSD: agp_i810.c,v 1.15 2003/01/31 00:07:39 thorpej Exp $ */ /*- @@ -680,8 +680,7 @@ agp_i810_alloc_memory(struct vga_pci_softc *sc, int type, vsize_t size) } } - mem = malloc(sizeof *mem, M_DEVBUF, M_WAITOK); - bzero(mem, sizeof *mem); + mem = malloc(sizeof *mem, M_DEVBUF, M_WAITOK | M_ZERO); mem->am_id = sc->sc_nextid++; mem->am_size = size; mem->am_type = type; diff --git a/sys/dev/pci/if_san_xilinx.c b/sys/dev/pci/if_san_xilinx.c index 7c85bf0f1ed..dbcd6b91a13 100644 --- a/sys/dev/pci/if_san_xilinx.c +++ b/sys/dev/pci/if_san_xilinx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_san_xilinx.c,v 1.19 2007/09/12 13:56:40 chl Exp $ */ +/* $OpenBSD: if_san_xilinx.c,v 1.20 2007/09/17 01:33:33 krw Exp $ */ /*- * Copyright (c) 2001-2004 Sangoma Technologies (SAN) @@ -2390,11 +2390,10 @@ aft_alloc_rx_buffers(xilinx_softc_t *sc) SIMPLEQ_INIT(&sc->wp_rx_complete_list); /* allocate receive buffers in one cluster */ - buf = malloc(sizeof(*buf) * MAX_RX_BUF, M_DEVBUF, M_NOWAIT); + buf = malloc(sizeof(*buf) * MAX_RX_BUF, M_DEVBUF, M_NOWAIT | M_ZERO); if (buf == NULL) return (1); - bzero(buf, sizeof(*buf) * MAX_RX_BUF); sc->wp_rx_buffers = buf; sc->wp_rx_buffer_last = buf; diff --git a/sys/dev/pci/ips.c b/sys/dev/pci/ips.c index 97785355ab5..db873c0c345 100644 --- a/sys/dev/pci/ips.c +++ b/sys/dev/pci/ips.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ips.c,v 1.29 2007/06/06 20:51:13 grange Exp $ */ +/* $OpenBSD: ips.c,v 1.30 2007/09/17 01:33:33 krw Exp $ */ /* * Copyright (c) 2006, 2007 Alexander Yurchenko <grange@openbsd.org> @@ -951,9 +951,8 @@ ips_ccb_alloc(struct ips_softc *sc, int n) struct ips_ccb *ccb; int i; - if ((ccb = malloc(n * sizeof(*ccb), M_DEVBUF, M_NOWAIT)) == NULL) + if ((ccb = malloc(n * sizeof(*ccb), M_DEVBUF, M_NOWAIT|M_ZERO)) == NULL) return (NULL); - bzero(ccb, n * sizeof(*ccb)); for (i = 0; i < n; i++) { ccb[i].c_id = i; |