[PATCH] OSS: replace kmalloc()+memset() combos with kzalloc()
[sfrench/cifs-2.6.git] / sound / oss / es1371.c
index cc282a0cd539847d8b10be91d3a7551e5194d06b..974dd732b1499606c37d6b324e6b932a4dddab14 100644 (file)
 #include <linux/dma-mapping.h>
 #include <linux/mutex.h>
 #include <linux/mm.h>
+#include <linux/kernel.h>
 
 #include <asm/io.h>
 #include <asm/page.h>
@@ -2870,11 +2871,10 @@ static int __devinit es1371_probe(struct pci_dev *pcidev, const struct pci_devic
                printk(KERN_WARNING "es1371: architecture does not support 32bit PCI busmaster DMA\n");
                return i;
        }
-       if (!(s = kmalloc(sizeof(struct es1371_state), GFP_KERNEL))) {
+       if (!(s = kzalloc(sizeof(struct es1371_state), GFP_KERNEL))) {
                printk(KERN_WARNING PFX "out of memory\n");
                return -ENOMEM;
        }
-       memset(s, 0, sizeof(struct es1371_state));
        
        s->codec = ac97_alloc_codec();
        if(s->codec == NULL)
@@ -2998,7 +2998,7 @@ static int __devinit es1371_probe(struct pci_dev *pcidev, const struct pci_devic
        set_fs(KERNEL_DS);
        val = SOUND_MASK_LINE;
        mixdev_ioctl(s->codec, SOUND_MIXER_WRITE_RECSRC, (unsigned long)&val);
-       for (i = 0; i < sizeof(initvol)/sizeof(initvol[0]); i++) {
+       for (i = 0; i < ARRAY_SIZE(initvol); i++) {
                val = initvol[i].vol;
                mixdev_ioctl(s->codec, initvol[i].mixch, (unsigned long)&val);
        }