Re: [PATCH] ASoC: tlv320aic3x - fix variable may be used uninitialized warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Nov 24, 2010 at 10:40:59PM +0800, Axel Lin wrote:
> If aic3x_read failed , val is used uninitialized.
> Fix it by initializing val to 0.
> 
> This patch fixes below compile warning:
> sound/soc/codecs/tlv320aic3x.c: In function 'aic3x_get_gpio':
> sound/soc/codecs/tlv320aic3x.c:1183: warning: 'val' may be used uninitialized in this function
> sound/soc/codecs/tlv320aic3x.c: In function 'aic3x_headset_detected':
> sound/soc/codecs/tlv320aic3x.c:1211: warning: 'val' may be used uninitialized in this function
> sound/soc/codecs/tlv320aic3x.c: In function 'aic3x_button_pressed':
> sound/soc/codecs/tlv320aic3x.c:1219: warning: 'val' may be used uninitialized in this function

This does rather look like a compiler bug.  I'm generally against this
sort of change as it just tramples over the warning in cases where it
may be valid, though given the trivially small functions here it's hard
to care.

Really this stuff should all be written to use the standard jack and
GPIO APIs anyway.
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel


[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux