[PATCH 1/3] ALSA: cs46xx: use vmalloc_array() to simplify code

Qianfeng Rong posted 3 patches 1 month, 1 week ago
[PATCH 1/3] ALSA: cs46xx: use vmalloc_array() to simplify code
Posted by Qianfeng Rong 1 month, 1 week ago
Remove array_size() calls and replace vmalloc() with vmalloc_array() in
cs46xx_dsp_spos_create() to simplify the code and maintain consistency
with existing kmalloc_array() usage.

Signed-off-by: Qianfeng Rong <rongqianfeng@vivo.com>
---
 sound/pci/cs46xx/dsp_spos.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/pci/cs46xx/dsp_spos.c b/sound/pci/cs46xx/dsp_spos.c
index e07f85322f1c..0aa68f9dd2aa 100644
--- a/sound/pci/cs46xx/dsp_spos.c
+++ b/sound/pci/cs46xx/dsp_spos.c
@@ -228,8 +228,8 @@ struct dsp_spos_instance *cs46xx_dsp_spos_create (struct snd_cs46xx * chip)
 
 	/* better to use vmalloc for this big table */
 	ins->symbol_table.symbols =
-		vmalloc(array_size(DSP_MAX_SYMBOLS,
-				   sizeof(struct dsp_symbol_entry)));
+		vmalloc_array(DSP_MAX_SYMBOLS,
+			      sizeof(struct dsp_symbol_entry));
 	ins->code.data = kmalloc(DSP_CODE_BYTE_SIZE, GFP_KERNEL);
 	ins->modules = kmalloc_array(DSP_MAX_MODULES,
 				     sizeof(struct dsp_module_desc),
-- 
2.34.1