Skip to contentSkip to conversation

ALSA:emu10k1 : Use vmalloc_array() instead of array_size in snd_emu10k1_efx_alloc_pm_buffer()

PATCH New longlong yan 1 participant 1 message Jul 15 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA:emu10k1 : Use vmalloc_array() instead of array_size in snd_emu10k1_efx_alloc_pm_buffer()

Change array_size() to vmalloc_array(), due to vmalloc_array() being optimized better, using fewer instructions, and handles overflow more concisely

Fixes 09668b441dac ("[ALSA] emu10k1 - Add PM support")
---
 sound/pci/emu10k1/emufx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/pci/emu10k1/emufx.c +1 -1
index 08e0556bf161..70b73b0439d7 100644
@@ -2625,7 +2625,7 @@ int snd_emu10k1_efx_alloc_pm_buffer(struct snd_emu10k1 *emu)
 	if (! emu->tram_val_saved || ! emu->tram_addr_saved)
 		return -ENOMEM;
 	len = emu->audigy ? 2 * 1024 : 2 * 512;
-	emu->saved_icode = vmalloc(array_size(len, 4));
+	emu->saved_icode = vmalloc_array(len, 4);
 	if (! emu->saved_icode)
 		return -ENOMEM;
 	return 0;
Signature · 1 line
2.43.0