diff options
author | Robert P. J. Day <rpjday@mindspring.com> | 2007-02-14 00:33:16 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-14 08:09:54 -0800 |
commit | 3159f06dc2303630c02d1ad2eeaeaf341414c9df (patch) | |
tree | 678779f605dac635df3932381933b3950a0052ba /sound/oss/cs46xx.c | |
parent | cd354f1ae75e6466a7e31b727faede57a1f89ca5 (diff) |
[PATCH] OSS: replace kmalloc()+memset() combos with kzalloc()
Replace kmalloc() + memset() pairs with the appropriate kzalloc() calls.
Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'sound/oss/cs46xx.c')
-rw-r--r-- | sound/oss/cs46xx.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/sound/oss/cs46xx.c b/sound/oss/cs46xx.c index 147c8a95113..2a1f0d9ac96 100644 --- a/sound/oss/cs46xx.c +++ b/sound/oss/cs46xx.c @@ -3048,10 +3048,9 @@ static int cs_open(struct inode *inode, struct file *file) CS_DBGOUT(CS_WAVE_READ, 2, printk("cs46xx: cs_open() FMODE_READ\n") ); if (card->states[0] == NULL) { state = card->states[0] = - kmalloc(sizeof(struct cs_state), GFP_KERNEL); + kzalloc(sizeof(struct cs_state), GFP_KERNEL); if (state == NULL) return -ENOMEM; - memset(state, 0, sizeof(struct cs_state)); mutex_init(&state->sem); dmabuf = &state->dmabuf; dmabuf->pbuf = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA); @@ -3114,10 +3113,9 @@ static int cs_open(struct inode *inode, struct file *file) CS_DBGOUT(CS_OPEN, 2, printk("cs46xx: cs_open() FMODE_WRITE\n") ); if (card->states[1] == NULL) { state = card->states[1] = - kmalloc(sizeof(struct cs_state), GFP_KERNEL); + kzalloc(sizeof(struct cs_state), GFP_KERNEL); if (state == NULL) return -ENOMEM; - memset(state, 0, sizeof(struct cs_state)); mutex_init(&state->sem); dmabuf = &state->dmabuf; dmabuf->pbuf = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA); @@ -5075,11 +5073,10 @@ static int __devinit cs46xx_probe(struct pci_dev *pci_dev, pci_read_config_word(pci_dev, PCI_SUBSYSTEM_VENDOR_ID, &ss_vendor); pci_read_config_word(pci_dev, PCI_SUBSYSTEM_ID, &ss_card); - if ((card = kmalloc(sizeof(struct cs_card), GFP_KERNEL)) == NULL) { + if ((card = kzalloc(sizeof(struct cs_card), GFP_KERNEL)) == NULL) { printk(KERN_ERR "cs46xx: out of memory\n"); return -ENOMEM; } - memset(card, 0, sizeof(*card)); card->ba0_addr = RSRCADDRESS(pci_dev, 0); card->ba1_addr = RSRCADDRESS(pci_dev, 1); card->pci_dev = pci_dev; |