[alsa-devel] Missing return check of of_property_read_*()

Takashi Iwai tiwai at suse.de
Wed Sep 9 17:05:18 CEST 2015


On Wed, 09 Sep 2015 16:55:53 +0200,
Brian Austin wrote:
> 
> On Wed, 9 Sep 2015, Mark Brown wrote:
> 
> > On Wed, Sep 09, 2015 at 04:40:36PM +0200, Takashi Iwai wrote:
> > 
> > > I hoped that I wouldn't need to write this kind of post, but since
> > > nothing happened so far, so here we go:
> > 
> > Could you be more specific about nothing happening here...
> > 
> > > The following compile warnings are present for quite some time.  They
> > > are due to the lack of return check from of_property_read*().
> > 
> > > sound/soc/codecs/cs35l32.c: In function ‘cs35l32_i2c_probe’:
> > > sound/soc/codecs/cs35l32.c:278:2: warning: ‘val’ may be used uninitialized in this function [-Wmaybe-uninitialized]
> > >   switch (val) {
> > >   ^
> > > sound/soc/codecs/cs35l32.c:272:15: note: ‘val’ was declared here
> > >   unsigned int val;
> > >                ^
> > 
> > How are you generating these - what compiler and config?  None of the
> > build bots are reporting any of the warnings you have here.
> > 
> Shouldn't that build server at Intel catch these? I usually get emails 
> about things like this from them.

Maybe depending on gcc version.  But it's interesting if no other
static analyzer hits this, too.

I'm considering whether adding __must_check to of_property_read*()
would make sense.  Then it'll be caught no matter which gcc version is
used.  But this would hit too many spots.


Takashi


More information about the Alsa-devel mailing list