* [PATCH v2] ALSA: maestro3: using vmalloc_array() to handle the code
@ 2025-10-24 10:55 tanze
2025-10-24 11:05 ` Philipp Stanner
2025-10-27 9:08 ` Takashi Iwai
0 siblings, 2 replies; 3+ messages in thread
From: tanze @ 2025-10-24 10:55 UTC (permalink / raw)
To: phasta, perex, phasta, tiwai; +Cc: linux-kernel, linux-sound, tanze
Change array_size() to vmalloc_array(), due to vmalloc_array()
being optimized better, using fewer instructions, and handles
overflow more concisely.
Signed-off-by: tanze <tanze@kylinos.cn>
---
Hi, Philipp Stanner,
Thank you for your suggestions.
I have made revisions according to your requirements.
Regarding the issue of my full name, thank you for your
attention to detail. Since I am in China, I use the name
"tanze" on many occasions, and the code I previously submitted
to the upstream community was also under this name.
---
Changes in v2:
- Fix some issues in the commit message.
v1:
- patch: https://lore.kernel.org/all/20251022092339.551438-1-tanze@kylinos.cn/
Best regards,
Ze Tan
---
sound/pci/maestro3.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/sound/pci/maestro3.c b/sound/pci/maestro3.c
index bddf47a1f263..3353980d5cd8 100644
--- a/sound/pci/maestro3.c
+++ b/sound/pci/maestro3.c
@@ -2571,9 +2571,9 @@ 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.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] ALSA: maestro3: using vmalloc_array() to handle the code
2025-10-24 10:55 [PATCH v2] ALSA: maestro3: using vmalloc_array() to handle the code tanze
@ 2025-10-24 11:05 ` Philipp Stanner
2025-10-27 9:08 ` Takashi Iwai
1 sibling, 0 replies; 3+ messages in thread
From: Philipp Stanner @ 2025-10-24 11:05 UTC (permalink / raw)
To: tanze, perex, phasta, tiwai; +Cc: linux-kernel, linux-sound
On Fri, 2025-10-24 at 18:55 +0800, tanze wrote:
> Change array_size() to vmalloc_array(), due to vmalloc_array()
> being optimized better, using fewer instructions, and handles
> overflow more concisely.
>
> Signed-off-by: tanze <tanze@kylinos.cn>
Reviewed-by: Philipp Stanner <phasta@kernel.org>
> ---
> Hi, Philipp Stanner,
>
> Thank you for your suggestions.
> I have made revisions according to your requirements.
>
> Regarding the issue of my full name, thank you for your
> attention to detail. Since I am in China, I use the name
> "tanze" on many occasions, and the code I previously submitted
> to the upstream community was also under this name.
> ---
> Changes in v2:
> - Fix some issues in the commit message.
>
> v1:
> - patch: https://lore.kernel.org/all/20251022092339.551438-1-tanze@kylinos.cn/
>
> Best regards,
> Ze Tan
Well, if your name is Ze Tan you could use that :)
Don't get me wrong, it's not a huge issue; tanze just might raise an
eyebrow here and there and have people wonder whether that's a
pseudonym or nickname or sth.
What's fine for Takashi is fine for me.
Regards
Philipp
> ---
> sound/pci/maestro3.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/sound/pci/maestro3.c b/sound/pci/maestro3.c
> index bddf47a1f263..3353980d5cd8 100644
> --- a/sound/pci/maestro3.c
> +++ b/sound/pci/maestro3.c
> @@ -2571,9 +2571,9 @@ 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");
> }
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] ALSA: maestro3: using vmalloc_array() to handle the code
2025-10-24 10:55 [PATCH v2] ALSA: maestro3: using vmalloc_array() to handle the code tanze
2025-10-24 11:05 ` Philipp Stanner
@ 2025-10-27 9:08 ` Takashi Iwai
1 sibling, 0 replies; 3+ messages in thread
From: Takashi Iwai @ 2025-10-27 9:08 UTC (permalink / raw)
To: tanze; +Cc: phasta, perex, phasta, tiwai, linux-kernel, linux-sound
On Fri, 24 Oct 2025 12:55:49 +0200,
tanze wrote:
>
> Change array_size() to vmalloc_array(), due to vmalloc_array()
> being optimized better, using fewer instructions, and handles
> overflow more concisely.
>
> Signed-off-by: tanze <tanze@kylinos.cn>
> ---
> Hi, Philipp Stanner,
>
> Thank you for your suggestions.
> I have made revisions according to your requirements.
>
> Regarding the issue of my full name, thank you for your
> attention to detail. Since I am in China, I use the name
> "tanze" on many occasions, and the code I previously submitted
> to the upstream community was also under this name.
> ---
> Changes in v2:
> - Fix some issues in the commit message.
>
> v1:
> - patch: https://lore.kernel.org/all/20251022092339.551438-1-tanze@kylinos.cn/
>
> Best regards,
> Ze Tan
Applied now to for-next branch.
A name spelling like "tanze" seems seen often for Chinese names, so I
don't think it's a problem (although it appears somehow strange for
western countries).
thanks,
Takashi
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-10-27 9:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-24 10:55 [PATCH v2] ALSA: maestro3: using vmalloc_array() to handle the code tanze
2025-10-24 11:05 ` Philipp Stanner
2025-10-27 9:08 ` Takashi Iwai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox