diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2007-10-01 15:34:49 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2007-10-01 15:34:49 +0000 |
commit | a730dedabc875f93e81898068b1cccdb9e45cb7c (patch) | |
tree | 059cc27503e1389b0da52a36e3fd0e692e1f24e2 /sys/dev/pci/if_sandrv.c | |
parent | d75aaeaf6b0231dbe849cd06ddac7f63b1e30bcc (diff) |
More easy bzero() -> M_ZERO. Use 'p = malloc(sizeof(*p) ...' where
obvious.
Diffstat (limited to 'sys/dev/pci/if_sandrv.c')
-rw-r--r-- | sys/dev/pci/if_sandrv.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/sys/dev/pci/if_sandrv.c b/sys/dev/pci/if_sandrv.c index b0687a6aa24..2782022a93e 100644 --- a/sys/dev/pci/if_sandrv.c +++ b/sys/dev/pci/if_sandrv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_sandrv.c,v 1.11 2006/04/20 20:31:12 miod Exp $ */ +/* $OpenBSD: if_sandrv.c,v 1.12 2007/10/01 15:34:48 krw Exp $ */ /*- * Copyright (c) 2001-2004 Sangoma Technologies (SAN) @@ -396,12 +396,10 @@ sdla_save_hw_probe(sdlahw_t *hw, int port) { sdla_hw_probe_t *tmp_hw_probe; - tmp_hw_probe = malloc(sizeof(sdla_hw_probe_t), M_DEVBUF, M_NOWAIT); + tmp_hw_probe = malloc(sizeof(*tmp_hw_probe), M_DEVBUF, M_NOWAIT|M_ZERO); if (tmp_hw_probe == NULL) return; - bzero(tmp_hw_probe, sizeof(sdla_hw_probe_t)); - snprintf(tmp_hw_probe->hw_info, sizeof(tmp_hw_probe->hw_info), "%s : SLOT=%d : BUS=%d : IRQ=%d : CPU=%c : PORT=%s", SDLA_ADPTR_DECODE(hw->hwcard->atype), hw->hwcard->slot_no, @@ -581,12 +579,10 @@ sdla_card_register(u_int16_t atype, int slot_no, int bus_no) if (new_hwcard) return (new_hwcard); - new_hwcard = malloc(sizeof(sdlahw_card_t), M_DEVBUF, M_NOWAIT); + new_hwcard = malloc(sizeof(*new_hwcard), M_DEVBUF, M_NOWAIT | M_ZERO); if (!new_hwcard) return (NULL); - bzero(new_hwcard, sizeof(sdlahw_card_t)); - new_hwcard->atype = atype; new_hwcard->slot_no = slot_no; new_hwcard->bus_no = bus_no; @@ -667,12 +663,10 @@ sdla_hw_register(sdlahw_card_t *card, int cpu_no, int irq, void *dev) if (new_hw) return (new_hw); - new_hw = malloc(sizeof(sdlahw_t), M_DEVBUF, M_NOWAIT); + new_hw = malloc(sizeof(*new_hw), M_DEVBUF, M_NOWAIT | M_ZERO); if (!new_hw) return (NULL); - bzero(new_hw, sizeof(sdlahw_t)); - new_hw->cpu_no = cpu_no; new_hw->irq = irq; new_hw->hwcard = card; |