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

Takashi Iwai <[email protected]>
Newsgroups org.kernel.vger.linux-sound,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
On Tue, 28 Jul 2026 10:12:51 +0200,
[email protected] wrote:
> 
> From: bui duc phuc <[email protected]>
> 
> 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 <[email protected]>
> ---
>  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
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.