summaryrefslogtreecommitdiffstats
path: root/sound/oss/i810_audio.c
diff options
context:
space:
mode:
authorRobert P. J. Day <rpjday@mindspring.com>2007-02-14 00:33:16 -0800
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-14 08:09:54 -0800
commit3159f06dc2303630c02d1ad2eeaeaf341414c9df (patch)
tree678779f605dac635df3932381933b3950a0052ba /sound/oss/i810_audio.c
parentcd354f1ae75e6466a7e31b727faede57a1f89ca5 (diff)
downloadop-kernel-dev-3159f06dc2303630c02d1ad2eeaeaf341414c9df.zip
op-kernel-dev-3159f06dc2303630c02d1ad2eeaeaf341414c9df.tar.gz
[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.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/sound/oss/i810_audio.c b/sound/oss/i810_audio.c
index c3c8a72..f5e31f1 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)
for (i = 0; i < NR_HW_CH && card && !card->initializing; i++) {
if (card->states[i] == NULL) {
state = card->states[i] = (struct i810_state *)
- kmalloc(sizeof(struct i810_state), GFP_KERNEL);
+ kzalloc(sizeof(struct i810_state), GFP_KERNEL);
if (state == NULL)
return -ENOMEM;
- memset(state, 0, sizeof(struct i810_state));
dmabuf = &state->dmabuf;
goto found_virt;
}
@@ -3205,10 +3204,9 @@ static void __devinit i810_configure_clocking (void)
*/
if(card != NULL) {
state = card->states[0] = (struct i810_state *)
- kmalloc(sizeof(struct i810_state), GFP_KERNEL);
+ kzalloc(sizeof(struct i810_state), GFP_KERNEL);
if (state == NULL)
return;
- memset(state, 0, sizeof(struct i810_state));
dmabuf = &state->dmabuf;
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
return -ENODEV;
}
- if ((card = kmalloc(sizeof(struct i810_card), GFP_KERNEL)) == NULL) {
+ if ((card = kzalloc(sizeof(struct i810_card), GFP_KERNEL)) == NULL) {
printk(KERN_ERR "i810_audio: out of memory\n");
return -ENOMEM;
}
- memset(card, 0, sizeof(*card));
card->initializing = 1;
card->pci_dev = pci_dev;
OpenPOWER on IntegriCloud