summaryrefslogtreecommitdiffstats
path: root/sys/pci/pci.c
diff options
context:
space:
mode:
authordwmalone <dwmalone@FreeBSD.org>2000-12-08 21:51:06 +0000
committerdwmalone <dwmalone@FreeBSD.org>2000-12-08 21:51:06 +0000
commitdd75d1d73b4f3034c1d9f621a49fff58b1d71eb1 (patch)
tree197ae73617ae75afe008897f6906b84835589ea2 /sys/pci/pci.c
parented5dbfbd3cd619638a7baac288f548aa1398edac (diff)
downloadFreeBSD-src-dd75d1d73b4f3034c1d9f621a49fff58b1d71eb1.zip
FreeBSD-src-dd75d1d73b4f3034c1d9f621a49fff58b1d71eb1.tar.gz
Convert more malloc+bzero to malloc+M_ZERO.
Submitted by: josh@zipperup.org Submitted by: Robert Drehmel <robd@gmx.net>
Diffstat (limited to 'sys/pci/pci.c')
-rw-r--r--sys/pci/pci.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/sys/pci/pci.c b/sys/pci/pci.c
index 2e5b9c5..c87e8e4 100644
--- a/sys/pci/pci.c
+++ b/sys/pci/pci.c
@@ -185,12 +185,10 @@ pci_readppb(device_t pcib, int b, int s, int f)
{
pcih1cfgregs *p;
- p = malloc(sizeof (pcih1cfgregs), M_DEVBUF, M_WAITOK);
+ p = malloc(sizeof (pcih1cfgregs), M_DEVBUF, M_WAITOK | M_ZERO);
if (p == NULL)
return (NULL);
- bzero(p, sizeof *p);
-
p->secstat = PCIB_READ_CONFIG(pcib, b, s, f, PCIR_SECSTAT_1, 2);
p->bridgectl = PCIB_READ_CONFIG(pcib, b, s, f, PCIR_BRIDGECTL_1, 2);
@@ -231,12 +229,10 @@ pci_readpcb(device_t pcib, int b, int s, int f)
{
pcih2cfgregs *p;
- p = malloc(sizeof (pcih2cfgregs), M_DEVBUF, M_WAITOK);
+ p = malloc(sizeof (pcih2cfgregs), M_DEVBUF, M_WAITOK | M_ZERO);
if (p == NULL)
return (NULL);
- bzero(p, sizeof *p);
-
p->secstat = PCIB_READ_CONFIG(pcib, b, s, f, PCIR_SECSTAT_2, 2);
p->bridgectl = PCIB_READ_CONFIG(pcib, b, s, f, PCIR_BRIDGECTL_2, 2);
@@ -304,10 +300,9 @@ pci_read_device(device_t pcib, int b, int s, int f)
if (PCIB_READ_CONFIG(pcib, b, s, f, PCIR_DEVVENDOR, 4) != -1) {
devlist_entry = malloc(sizeof(struct pci_devinfo),
- M_DEVBUF, M_WAITOK);
+ M_DEVBUF, M_WAITOK | M_ZERO);
if (devlist_entry == NULL)
return (NULL);
- bzero(devlist_entry, sizeof *devlist_entry);
cfg = &devlist_entry->cfg;
OpenPOWER on IntegriCloud