[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250824135521.590780-4-rongqianfeng@vivo.com>
Date: Sun, 24 Aug 2025 21:55:12 +0800
From: Qianfeng Rong <rongqianfeng@...o.com>
To: Jaroslav Kysela <perex@...ex.cz>,
Takashi Iwai <tiwai@...e.com>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Qianfeng Rong <rongqianfeng@...o.com>,
Philipp Stanner <phasta@...nel.org>,
linux-sound@...r.kernel.org (open list:SOUND),
linux-kernel@...r.kernel.org (open list)
Subject: [PATCH 3/3] ALSA: maestro3: use vmalloc_array() to simplify code
Remove array_size() calls and replace vmalloc() with vmalloc_array() in
snd_m3_create() to simplify the code.
Signed-off-by: Qianfeng Rong <rongqianfeng@...o.com>
---
sound/pci/maestro3.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/sound/pci/maestro3.c b/sound/pci/maestro3.c
index e092097599ff..0170b432402b 100644
--- a/sound/pci/maestro3.c
+++ b/sound/pci/maestro3.c
@@ -2580,9 +2580,8 @@ snd_m3_create(struct snd_card *card, struct pci_dev *pci,
if (IS_ENABLED(CONFIG_PM_SLEEP)) {
chip->suspend_mem =
- vmalloc(array_size(sizeof(u16),
- REV_B_CODE_MEMORY_LENGTH +
- REV_B_DATA_MEMORY_LENGTH));
+ vmalloc_array(REV_B_CODE_MEMORY_LENGTH +
+ REV_B_DATA_MEMORY_LENGTH, sizeof(u16));
if (!chip->suspend_mem)
dev_warn(card->dev, "can't allocate apm buffer\n");
}
--
2.34.1
Powered by blists - more mailing lists