summaryrefslogtreecommitdiffstats
path: root/sys/dev/cardbus
diff options
context:
space:
mode:
authorjon <jon@FreeBSD.org>2000-11-27 23:55:19 +0000
committerjon <jon@FreeBSD.org>2000-11-27 23:55:19 +0000
commitcd0ac284b9dc545ef14482a3092c01cbb7f5432e (patch)
tree5f2d6fbf5951ad145ed387be8e5eaab877f1be30 /sys/dev/cardbus
parent9326f655fcd4caf90e69a0e773ed128fe10e8996 (diff)
downloadFreeBSD-src-cd0ac284b9dc545ef14482a3092c01cbb7f5432e.zip
FreeBSD-src-cd0ac284b9dc545ef14482a3092c01cbb7f5432e.tar.gz
Patch to use M_ZERO
Submitted by: David Malone
Diffstat (limited to 'sys/dev/cardbus')
-rw-r--r--sys/dev/cardbus/cardbus.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/sys/dev/cardbus/cardbus.c b/sys/dev/cardbus/cardbus.c
index 2d68310..acee08e 100644
--- a/sys/dev/cardbus/cardbus.c
+++ b/sys/dev/cardbus/cardbus.c
@@ -297,10 +297,9 @@ cardbus_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 cardbus_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;
@@ -386,12 +385,10 @@ cardbus_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);
@@ -432,12 +429,10 @@ cardbus_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);
OpenPOWER on IntegriCloud