diff options
author | Robert P. J. Day <rpjday@mindspring.com> | 2007-02-14 03:33:16 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-14 11:09:54 -0500 |
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 147c8a951137..2a1f0d9ac968 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) | |||
3048 | CS_DBGOUT(CS_WAVE_READ, 2, printk("cs46xx: cs_open() FMODE_READ\n") ); | 3048 | CS_DBGOUT(CS_WAVE_READ, 2, printk("cs46xx: cs_open() FMODE_READ\n") ); |
3049 | if (card->states[0] == NULL) { | 3049 | if (card->states[0] == NULL) { |
3050 | state = card->states[0] = | 3050 | state = card->states[0] = |
3051 | kmalloc(sizeof(struct cs_state), GFP_KERNEL); | 3051 | kzalloc(sizeof(struct cs_state), GFP_KERNEL); |
3052 | if (state == NULL) | 3052 | if (state == NULL) |
3053 | return -ENOMEM; | 3053 | return -ENOMEM; |
3054 | memset(state, 0, sizeof(struct cs_state)); | ||
3055 | mutex_init(&state->sem); | 3054 | mutex_init(&state->sem); |
3056 | dmabuf = &state->dmabuf; | 3055 | dmabuf = &state->dmabuf; |
3057 | dmabuf->pbuf = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA); | 3056 | dmabuf->pbuf = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA); |
@@ -3114,10 +3113,9 @@ static int cs_open(struct inode *inode, struct file *file) | |||
3114 | CS_DBGOUT(CS_OPEN, 2, printk("cs46xx: cs_open() FMODE_WRITE\n") ); | 3113 | CS_DBGOUT(CS_OPEN, 2, printk("cs46xx: cs_open() FMODE_WRITE\n") ); |
3115 | if (card->states[1] == NULL) { | 3114 | if (card->states[1] == NULL) { |
3116 | state = card->states[1] = | 3115 | state = card->states[1] = |
3117 | kmalloc(sizeof(struct cs_state), GFP_KERNEL); | 3116 | kzalloc(sizeof(struct cs_state), GFP_KERNEL); |
3118 | if (state == NULL) | 3117 | if (state == NULL) |
3119 | return -ENOMEM; | 3118 | return -ENOMEM; |
3120 | memset(state, 0, sizeof(struct cs_state)); | ||
3121 | mutex_init(&state->sem); | 3119 | mutex_init(&state->sem); |
3122 | dmabuf = &state->dmabuf; | 3120 | dmabuf = &state->dmabuf; |
3123 | dmabuf->pbuf = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA); | 3121 | dmabuf->pbuf = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA); |
@@ -5075,11 +5073,10 @@ static int __devinit cs46xx_probe(struct pci_dev *pci_dev, | |||
5075 | pci_read_config_word(pci_dev, PCI_SUBSYSTEM_VENDOR_ID, &ss_vendor); | 5073 | pci_read_config_word(pci_dev, PCI_SUBSYSTEM_VENDOR_ID, &ss_vendor); |
5076 | pci_read_config_word(pci_dev, PCI_SUBSYSTEM_ID, &ss_card); | 5074 | pci_read_config_word(pci_dev, PCI_SUBSYSTEM_ID, &ss_card); |
5077 | 5075 | ||
5078 | if ((card = kmalloc(sizeof(struct cs_card), GFP_KERNEL)) == NULL) { | 5076 | if ((card = kzalloc(sizeof(struct cs_card), GFP_KERNEL)) == NULL) { |
5079 | printk(KERN_ERR "cs46xx: out of memory\n"); | 5077 | printk(KERN_ERR "cs46xx: out of memory\n"); |
5080 | return -ENOMEM; | 5078 | return -ENOMEM; |
5081 | } | 5079 | } |
5082 | memset(card, 0, sizeof(*card)); | ||
5083 | card->ba0_addr = RSRCADDRESS(pci_dev, 0); | 5080 | card->ba0_addr = RSRCADDRESS(pci_dev, 0); |
5084 | card->ba1_addr = RSRCADDRESS(pci_dev, 1); | 5081 | card->ba1_addr = RSRCADDRESS(pci_dev, 1); |
5085 | card->pci_dev = pci_dev; | 5082 | card->pci_dev = pci_dev; |