All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ALSA: snd-usb-caiaq: initialize card pointer
@ 2012-06-18 19:16 Daniel Mack
  2012-06-27  7:57 ` Daniel Mack
  2012-06-27 10:30 ` Takashi Iwai
  0 siblings, 2 replies; 3+ messages in thread
From: Daniel Mack @ 2012-06-18 19:16 UTC (permalink / raw)
  To: alsa-devel; +Cc: tiwai, clemens, Daniel Mack

Fixes the following warning:

  CC [M]  sound/usb/caiaq/device.o
sound/usb/caiaq/device.c: In function ‘snd_probe’:
sound/usb/caiaq/device.c:500:16: warning: ‘card’ may be used
uninitialized in this function [-Wmaybe-uninitialized]

Signed-off-by: Daniel Mack <zonque@gmail.com>
---
 sound/usb/caiaq/device.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/usb/caiaq/device.c b/sound/usb/caiaq/device.c
index 64aed43..7da0d0a 100644
--- a/sound/usb/caiaq/device.c
+++ b/sound/usb/caiaq/device.c
@@ -485,7 +485,7 @@ static int __devinit snd_probe(struct usb_interface *intf,
 		     const struct usb_device_id *id)
 {
 	int ret;
-	struct snd_card *card;
+	struct snd_card *card = NULL;
 	struct usb_device *device = interface_to_usbdev(intf);
 
 	ret = create_card(device, intf, &card);
-- 
1.7.10.2

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

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

* Re: [PATCH] ALSA: snd-usb-caiaq: initialize card pointer
  2012-06-18 19:16 [PATCH] ALSA: snd-usb-caiaq: initialize card pointer Daniel Mack
@ 2012-06-27  7:57 ` Daniel Mack
  2012-06-27 10:30 ` Takashi Iwai
  1 sibling, 0 replies; 3+ messages in thread
From: Daniel Mack @ 2012-06-27  7:57 UTC (permalink / raw)
  To: tiwai; +Cc: alsa-devel

ping

On 18.06.2012 21:16, Daniel Mack wrote:
> Fixes the following warning:
> 
>   CC [M]  sound/usb/caiaq/device.o
> sound/usb/caiaq/device.c: In function ‘snd_probe’:
> sound/usb/caiaq/device.c:500:16: warning: ‘card’ may be used
> uninitialized in this function [-Wmaybe-uninitialized]
> 
> Signed-off-by: Daniel Mack <zonque@gmail.com>
> ---
>  sound/usb/caiaq/device.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/sound/usb/caiaq/device.c b/sound/usb/caiaq/device.c
> index 64aed43..7da0d0a 100644
> --- a/sound/usb/caiaq/device.c
> +++ b/sound/usb/caiaq/device.c
> @@ -485,7 +485,7 @@ static int __devinit snd_probe(struct usb_interface *intf,
>  		     const struct usb_device_id *id)
>  {
>  	int ret;
> -	struct snd_card *card;
> +	struct snd_card *card = NULL;
>  	struct usb_device *device = interface_to_usbdev(intf);
>  
>  	ret = create_card(device, intf, &card);
> 


_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

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

* Re: [PATCH] ALSA: snd-usb-caiaq: initialize card pointer
  2012-06-18 19:16 [PATCH] ALSA: snd-usb-caiaq: initialize card pointer Daniel Mack
  2012-06-27  7:57 ` Daniel Mack
@ 2012-06-27 10:30 ` Takashi Iwai
  1 sibling, 0 replies; 3+ messages in thread
From: Takashi Iwai @ 2012-06-27 10:30 UTC (permalink / raw)
  To: Daniel Mack; +Cc: alsa-devel, clemens

At Mon, 18 Jun 2012 21:16:31 +0200,
Daniel Mack wrote:
> 
> Fixes the following warning:
> 
>   CC [M]  sound/usb/caiaq/device.o
> sound/usb/caiaq/device.c: In function ‘snd_probe’:
> sound/usb/caiaq/device.c:500:16: warning: ‘card’ may be used
> uninitialized in this function [-Wmaybe-uninitialized]
> 
> Signed-off-by: Daniel Mack <zonque@gmail.com>
> ---
>  sound/usb/caiaq/device.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/sound/usb/caiaq/device.c b/sound/usb/caiaq/device.c
> index 64aed43..7da0d0a 100644
> --- a/sound/usb/caiaq/device.c
> +++ b/sound/usb/caiaq/device.c
> @@ -485,7 +485,7 @@ static int __devinit snd_probe(struct usb_interface *intf,
>  		     const struct usb_device_id *id)
>  {
>  	int ret;
> -	struct snd_card *card;
> +	struct snd_card *card = NULL;

It's always a question how to "fix" such a problem.
The first option is to assign some "reasonable" value.  Like your patch.
The second option is to use uninitialized_var().
The last option is to ignore it.  It's gcc to blame.

I don't mind too much about such a trivial thing, so I just took your
patch now.


thanks,

Takashi


>  	struct usb_device *device = interface_to_usbdev(intf);
>  
>  	ret = create_card(device, intf, &card);
> -- 
> 1.7.10.2
> 
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

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

end of thread, other threads:[~2012-06-27 10:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-18 19:16 [PATCH] ALSA: snd-usb-caiaq: initialize card pointer Daniel Mack
2012-06-27  7:57 ` Daniel Mack
2012-06-27 10:30 ` 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.