[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <38901e63-422b-4154-ac39-8edde1d98216@kylinos.cn>
Date: Thu, 23 Oct 2025 14:51:32 +0800
From: tanze <tanze@...inos.cn>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc: perex@...ex.cz, tiwai@...e.com, phasta@...nel.org,
linux-sound@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] ALSA: emu10k1: using vmalloc_array() to handle the code
在 2025/10/23 14:35, Andy Shevchenko 写道:
> On Wed, Oct 22, 2025 at 05:27:38PM +0800, tanze wrote:
>> Change array_size() to vmalloc_array(), Due to vmalloc_array()
>> is optimized better,uses fewer instructions, and handles
>
> better, uses
>
> (mind a space after a comma)
>
Thank you for pointing out the mistake. I will correct
the error in the description in a subsequent version.
>> overflow more concisely
>
> concisely.
>
> (mind a period at the end)
>
> ...
>
>> - emu->p16v_saved = vmalloc(array_size(NUM_CHS * 4, 0x80));
>> + emu->p16v_saved = vmalloc_array(NUM_CHS * 4, 0x80);
>
> I think this should be
>
> emu->p16v_saved = vmalloc(array3_size(NUM_CHS, 4, 0x80));
>
> Or, if we have vmalloc_array3(), which I doubt, use it.
>
> But since NUM_CHS sounds like a compile time constant, the above approach may
> work too.
>
Hi, Andy Shevchenko.
I just checked the code and found that vmalloc_array3() does not exist
yet. Initially, I only thought that vmalloc_array() is better and more
concise than vmalloc(array3_size()). What do you think would be the
better approach here?
> Anyway, this can be addressed later.
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
>
--
Best regards,
Ze Tan
Powered by blists - more mailing lists