* [PATCH] em28xx: fix uninitialized variable warning
@ 2014-09-29 9:48 Hans Verkuil
0 siblings, 0 replies; only message in thread
From: Hans Verkuil @ 2014-09-29 9:48 UTC (permalink / raw)
To: linux-media
Fix this daily build warning:
In file included from build/media_build/v4l/em28xx-core.c:35:0:
build/media_build/v4l/em28xx-core.c: In function 'em28xx_audio_setup':
build/media_build/v4l/em28xx.h:798:2: warning: 'vid' may be used uninitialized in this function [-Wmaybe-uninitialized]
printk(KERN_INFO "%s: "fmt,\
^
build/media_build/v4l/em28xx-core.c:507:6: note: 'vid' was declared here
u32 vid;
^
As far as I can tell 'vid' can not really be used uninitialized here, but the code
is sufficiently complex that apparently gcc can't figure that out.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
diff --git a/drivers/media/usb/em28xx/em28xx-core.c b/drivers/media/usb/em28xx/em28xx-core.c
index b5e52fe..901cf2b 100644
--- a/drivers/media/usb/em28xx/em28xx-core.c
+++ b/drivers/media/usb/em28xx/em28xx-core.c
@@ -504,7 +504,7 @@ EXPORT_SYMBOL_GPL(em28xx_audio_analog_set);
int em28xx_audio_setup(struct em28xx *dev)
{
int vid1, vid2, feat, cfg;
- u32 vid;
+ u32 vid = 0;
u8 i2s_samplerates;
if (dev->chip_id == CHIP_ID_EM2870 ||
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2014-09-29 9:48 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-29 9:48 [PATCH] em28xx: fix uninitialized variable warning Hans Verkuil
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.