mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: tanze <tanze@kylinos.cn>
Cc: perex@perex.cz, tiwai@suse.com, phasta@kernel.org,
	linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ALSA: emu10k1: using vmalloc_array() to handle the code
Date: Thu, 23 Oct 2025 09:35:45 +0300	[thread overview]
Message-ID: <aPnMwXMuOk7bijHG@smile.fi.intel.com> (raw)
In-Reply-To: <20251022092738.552700-1-tanze@kylinos.cn>

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@linux.intel.com>

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2025-10-23  6:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-22  9:27 tanze
2025-10-23  6:35 ` Andy Shevchenko [this message]
2025-10-23  6:51   ` tanze

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aPnMwXMuOk7bijHG@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=phasta@kernel.org \
    --cc=tanze@kylinos.cn \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®