Skip to contentSkip to conversation

ALSA: core: Update snd_card_new() documentation

PATCH In review [email protected] 2 participants 5 messages Jul 28 – Jul 29 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: core: Update snd_card_new() documentation

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.

---
 sound/core/init.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
sound/core/init.c +3 -3
index 56dde5bd73c4..f3fa795ab932 100644
@@ -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;
Signature · 1 line
2.43.0
#1 lore raw
Quoted 6 lines · 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

Quoted 32 lines
---
 sound/core/init.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
sound/core/init.c +3 -3
index 56dde5bd73c4..f3fa795ab932 100644
@@ -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;
Signature · 1 line
2.43.0
#2 lore raw

Hi Takashi-san,

Thank you for your review.

Quoted 5 lines

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

#3 lore raw
Quoted 6 lines · Bui Duc Phuc

Hi Takashi-san,

Thank you for your review.

Quoted 1 line
Quoted 7 lines
Quoted 4 lines

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

#4 lore raw

Hi Takashi-san,

Thank you for your feedback.

Quoted 5 lines

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.

It's a pretty minor change, so I'll leave it for now.
I'm still looking into this area, and if I end up making other changes later, I'll include this in the same patch.

Best regards,
Phuc