All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ALSA: core: Update snd_card_new() documentation
@ 2026-07-28  8:12 phucduc.bui
  2026-07-28  8:37 ` Takashi Iwai
  0 siblings, 1 reply; 4+ messages in thread
From: phucduc.bui @ 2026-07-28  8:12 UTC (permalink / raw)
  To: cassiogabrielcontato, Takashi Iwai, Mark Brown, Jaroslav Kysela,
	Kees Cook, Cezary Rojewski
  Cc: linux-sound, linux-kernel, bui duc phuc

From: bui duc phuc <phucduc.bui@gmail.com>

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.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
 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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] ALSA: core: Update snd_card_new() documentation
  2026-07-28  8:12 [PATCH] ALSA: core: Update snd_card_new() documentation phucduc.bui
@ 2026-07-28  8:37 ` Takashi Iwai
  2026-07-28  8:47   ` Bui Duc Phuc
  0 siblings, 1 reply; 4+ messages in thread
From: Takashi Iwai @ 2026-07-28  8:37 UTC (permalink / raw)
  To: phucduc.bui
  Cc: cassiogabrielcontato, Takashi Iwai, Mark Brown, Jaroslav Kysela,
	Kees Cook, Cezary Rojewski, linux-sound, linux-kernel

On Tue, 28 Jul 2026 10:12:51 +0200,
phucduc.bui@gmail.com wrote:
> 
> From: bui duc phuc <phucduc.bui@gmail.com>
> 
> 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@gmail.com>
> ---
>  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
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ALSA: core: Update snd_card_new() documentation
  2026-07-28  8:37 ` Takashi Iwai
@ 2026-07-28  8:47   ` Bui Duc Phuc
  2026-07-28  8:56     ` Takashi Iwai
  0 siblings, 1 reply; 4+ messages in thread
From: Bui Duc Phuc @ 2026-07-28  8:47 UTC (permalink / raw)
  To: Takashi Iwai
  Cc: cassiogabrielcontato, Takashi Iwai, Mark Brown, Jaroslav Kysela,
	Kees Cook, Cezary Rojewski, linux-sound, linux-kernel

Hi Takashi-san,

Thank you for your review.

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

I understand now.
Should I keep the function parameter indentation fix?

Best regards,
Phuc

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ALSA: core: Update snd_card_new() documentation
  2026-07-28  8:47   ` Bui Duc Phuc
@ 2026-07-28  8:56     ` Takashi Iwai
  0 siblings, 0 replies; 4+ messages in thread
From: Takashi Iwai @ 2026-07-28  8:56 UTC (permalink / raw)
  To: Bui Duc Phuc
  Cc: Takashi Iwai, cassiogabrielcontato, Takashi Iwai, Mark Brown,
	Jaroslav Kysela, Kees Cook, Cezary Rojewski, linux-sound,
	linux-kernel

On Tue, 28 Jul 2026 10:47:26 +0200,
Bui Duc Phuc wrote:
> 
> Hi Takashi-san,
> 
> Thank you for your review.
> 
> >
> > Well, from the API documentation POV, it doesn't matter which function
> > is used internally.  The main point is that it does
> > zero-initialization.
> >
> 
> I understand now.
> Should I keep the function parameter indentation fix?

Honestly speaking, I don't care much about it :)

If any, you can resubmit a patch to rephrase the comment from
kzalloc() to zero-initialization, together with the indent fix.


thanks,

Takashi

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-07-28  8:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-28  8:12 [PATCH] ALSA: core: Update snd_card_new() documentation phucduc.bui
2026-07-28  8:37 ` Takashi Iwai
2026-07-28  8:47   ` Bui Duc Phuc
2026-07-28  8:56     ` Takashi Iwai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.