[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aPnMwXMuOk7bijHG@smile.fi.intel.com>
Date: Thu, 23 Oct 2025 09:35:45 +0300
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: tanze <tanze@...inos.cn>
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
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)
> 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.
Anyway, this can be addressed later.
Reviewed-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists