]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - sound/pci/emu10k1/emu10k1_main.c
treewide: Use array_size() in vmalloc()
[linux.git] / sound / pci / emu10k1 / emu10k1_main.c
index 18267de3a26993b834dfe9ad8f6fdc8363feda30..61f85ff91cd9ae39f91d485f09b0bbc40f026898 100644 (file)
@@ -1941,9 +1941,10 @@ int snd_emu10k1_create(struct snd_card *card,
                (unsigned long)emu->ptb_pages.addr,
                (unsigned long)(emu->ptb_pages.addr + emu->ptb_pages.bytes));
 
-       emu->page_ptr_table = vmalloc(emu->max_cache_pages * sizeof(void *));
-       emu->page_addr_table = vmalloc(emu->max_cache_pages *
-                                      sizeof(unsigned long));
+       emu->page_ptr_table = vmalloc(array_size(sizeof(void *),
+                                                emu->max_cache_pages));
+       emu->page_addr_table = vmalloc(array_size(sizeof(unsigned long),
+                                                 emu->max_cache_pages));
        if (emu->page_ptr_table == NULL || emu->page_addr_table == NULL) {
                err = -ENOMEM;
                goto error;
@@ -2099,7 +2100,7 @@ static int alloc_pm_buffer(struct snd_emu10k1 *emu)
        size = ARRAY_SIZE(saved_regs);
        if (emu->audigy)
                size += ARRAY_SIZE(saved_regs_audigy);
-       emu->saved_ptr = vmalloc(4 * NUM_G * size);
+       emu->saved_ptr = vmalloc(array3_size(4, NUM_G, size));
        if (!emu->saved_ptr)
                return -ENOMEM;
        if (snd_emu10k1_efx_alloc_pm_buffer(emu) < 0)