Re: [PATCH] ALSA: core: Update snd_card_new() documentation

From: Takashi Iwai

Date: Tue Jul 28 2026 - 04:40:43 EST


On Tue, 28 Jul 2026 10:12:51 +0200,
phucduc.bui@xxxxxxxxx wrote:
>
> From: bui duc phuc <phucduc.bui@xxxxxxxxx>
>
> The implementation of snd_card_new() now uses kzalloc_flex() instead
> of kzalloc(). Update the kernel-doc to match the implementation and
> fix the function parameter indentation.

Well, from the API documentation POV, it doesn't matter which function
is used internally. The main point is that it does
zero-initialization.


thanks,

Takashi


>
> Signed-off-by: bui duc phuc <phucduc.bui@xxxxxxxxx>
> ---
> sound/core/init.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/sound/core/init.c b/sound/core/init.c
> index 56dde5bd73c4..f3fa795ab932 100644
> --- a/sound/core/init.c
> +++ b/sound/core/init.c
> @@ -162,15 +162,15 @@ static void release_card_device(struct device *dev)
> * @extra_size: allocate this extra size after the main soundcard structure
> * @card_ret: the pointer to store the created card instance
> *
> - * The function allocates snd_card instance via kzalloc with the given
> + * The function allocates snd_card instance via kzalloc_flex with the given
> * space for the driver to use freely. The allocated struct is stored
> * in the given card_ret pointer.
> *
> * Return: Zero if successful or a negative error code.
> */
> int snd_card_new(struct device *parent, int idx, const char *xid,
> - struct module *module, int extra_size,
> - struct snd_card **card_ret)
> + struct module *module, int extra_size,
> + struct snd_card **card_ret)
> {
> struct snd_card *card;
> int err;
> --
> 2.43.0
>