mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] ALSA:emu10k1 : Use vmalloc_array() instead of array_size in snd_emu10k1_efx_alloc_pm_buffer()
@ 2026-07-15  6:59 longlong yan
  0 siblings, 0 replies; only message in thread
From: longlong yan @ 2026-07-15  6:59 UTC (permalink / raw)
  To: perex, tiwai, kees, linux-sound, linux-kernel; +Cc: longlong yan

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")
Signed-off-by: longlong yan <yanlonglong@kylinos.cn>
---
 sound/pci/emu10k1/emufx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/pci/emu10k1/emufx.c b/sound/pci/emu10k1/emufx.c
index 08e0556bf161..70b73b0439d7 100644
--- a/sound/pci/emu10k1/emufx.c
+++ b/sound/pci/emu10k1/emufx.c
@@ -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;
-- 
2.43.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-07-15  7:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-15  6:59 [PATCH] ALSA:emu10k1 : Use vmalloc_array() instead of array_size in snd_emu10k1_efx_alloc_pm_buffer() longlong yan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox