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/i810_audio.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/i810_audio.c')
-rw-r--r-- | sound/oss/i810_audio.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/sound/oss/i810_audio.c b/sound/oss/i810_audio.c index c3c8a720d555..f5e31f11973d 100644 --- a/sound/oss/i810_audio.c +++ b/sound/oss/i810_audio.c | |||
@@ -2580,10 +2580,9 @@ static int i810_open(struct inode *inode, struct file *file) | |||
2580 | for (i = 0; i < NR_HW_CH && card && !card->initializing; i++) { | 2580 | for (i = 0; i < NR_HW_CH && card && !card->initializing; i++) { |
2581 | if (card->states[i] == NULL) { | 2581 | if (card->states[i] == NULL) { |
2582 | state = card->states[i] = (struct i810_state *) | 2582 | state = card->states[i] = (struct i810_state *) |
2583 | kmalloc(sizeof(struct i810_state), GFP_KERNEL); | 2583 | kzalloc(sizeof(struct i810_state), GFP_KERNEL); |
2584 | if (state == NULL) | 2584 | if (state == NULL) |
2585 | return -ENOMEM; | 2585 | return -ENOMEM; |
2586 | memset(state, 0, sizeof(struct i810_state)); | ||
2587 | dmabuf = &state->dmabuf; | 2586 | dmabuf = &state->dmabuf; |
2588 | goto found_virt; | 2587 | goto found_virt; |
2589 | } | 2588 | } |
@@ -3205,10 +3204,9 @@ static void __devinit i810_configure_clocking (void) | |||
3205 | */ | 3204 | */ |
3206 | if(card != NULL) { | 3205 | if(card != NULL) { |
3207 | state = card->states[0] = (struct i810_state *) | 3206 | state = card->states[0] = (struct i810_state *) |
3208 | kmalloc(sizeof(struct i810_state), GFP_KERNEL); | 3207 | kzalloc(sizeof(struct i810_state), GFP_KERNEL); |
3209 | if (state == NULL) | 3208 | if (state == NULL) |
3210 | return; | 3209 | return; |
3211 | memset(state, 0, sizeof(struct i810_state)); | ||
3212 | dmabuf = &state->dmabuf; | 3210 | dmabuf = &state->dmabuf; |
3213 | 3211 | ||
3214 | dmabuf->write_channel = card->alloc_pcm_channel(card); | 3212 | dmabuf->write_channel = card->alloc_pcm_channel(card); |
@@ -3273,11 +3271,10 @@ static int __devinit i810_probe(struct pci_dev *pci_dev, const struct pci_device | |||
3273 | return -ENODEV; | 3271 | return -ENODEV; |
3274 | } | 3272 | } |
3275 | 3273 | ||
3276 | if ((card = kmalloc(sizeof(struct i810_card), GFP_KERNEL)) == NULL) { | 3274 | if ((card = kzalloc(sizeof(struct i810_card), GFP_KERNEL)) == NULL) { |
3277 | printk(KERN_ERR "i810_audio: out of memory\n"); | 3275 | printk(KERN_ERR "i810_audio: out of memory\n"); |
3278 | return -ENOMEM; | 3276 | return -ENOMEM; |
3279 | } | 3277 | } |
3280 | memset(card, 0, sizeof(*card)); | ||
3281 | 3278 | ||
3282 | card->initializing = 1; | 3279 | card->initializing = 1; |
3283 | card->pci_dev = pci_dev; | 3280 | card->pci_dev = pci_dev; |