[alsa-devel] Missing return check of of_property_read_*()
Fengguang Wu
fengguang.wu at intel.com
Thu Sep 10 08:24:32 CEST 2015
On Thu, Sep 10, 2015 at 07:32:04AM +0200, Takashi Iwai wrote:
> On Thu, 10 Sep 2015 05:23:44 +0200,
> Fengguang Wu wrote:
> >
> > On Thu, Sep 10, 2015 at 11:10:22AM +0800, Fengguang Wu wrote:
> > > Hi Takashi,
> > >
> > > > Fengguang, we've been discussing about the compile warnings that
> > > > weren't caught by 0days. It seems that it's triggered by !CONFIG_OF
> > > > but with CONFIG_COMPILE_TEST=y. Then I got warnings like:
> > > >
> > > > 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;
> > > > ^
> > > >
> > > > The above was with gcc-5.1.1, but Lars told that he saw such a warning
> > > > with gcc-4.9, too.
> > > >
> > > > Could you add this kind of kconfig in your test?
> > >
> > > It's covered through the lots of randconfig tests. However the problem
> > > is, they are pretty old warnings and 0day ignores old warnings because
> > > old warnings may well be intensionally ignored by people. On the
> > > contrast, build errors can be re-reported if remain unfixed for long time.
> >
> > That said, if as a maintainer you demand "all warnings should be quieted",
> > I'll happily help you reminding the people who break the rule.
> >
> > If it's a generally agreed rule by the maintainers, I'll be happy to
> > help guarantee it kernel wide.
>
> Well, there can be no black-or-white answer for this, as you know.
> Indeed, what annoys most is repeatedly mail combs for minor or false
> positive warnings. But sometimes checking warnings is useful; when I
> look through build warnings occasionally, it really hits real bugs
> sometimes.
That's true.
> So this made me wonder whether we have a way to take a glance through
> gathered compile warnings at once. Are they archived and reachable?
Yes. Here are the active "may be used uninitialized" warnings under sound/:
sound/core/pcm_lib.c:244: warning: 'curr_tstamp.tv_nsec' may be used uninitialized in this function
sound/core/pcm_lib.c:244: warning: 'curr_tstamp.tv_sec' may be used uninitialized in this function
sound/drivers/serial-u16550.c:966:9: warning: 'uart' may be used uninitialized in this function [-Wmaybe-uninitialized]
sound/firewire/bebob/bebob_focusrite.c:175:14: warning: 'value' may be used uninitialized in this function [-Wmaybe-uninitialized]
sound/pci/asihpi/hpi6205.c:605:5: warning: 'p_control_cache_virtual' may be used uninitialized in this function [-Wmaybe-uninitialized]
sound/pci/asihpi/hpioctl.c:304:17: warning: 'puhr' may be used uninitialized in this function [-Wmaybe-uninitialized]
sound/pci/atiixp.c:1683:14: warning: 'chip' may be used uninitialized in this function [-Wmaybe-uninitialized]
sound/pci/atiixp_modem.c:1314:2: warning: 'chip' may be used uninitialized in this function [-Wmaybe-uninitialized]
sound/pci/hda/hda_generic.c:2872:32: warning: 'mix_val' may be used uninitialized in this function [-Wmaybe-uninitialized]
sound/pci/hda/hda_generic.c:2875:305: warning: 'mute_val' may be used uninitialized in this function [-Wmaybe-uninitialized]
sound/pci/hda/patch_realtek.c:4826:12: warning: 'pin' may be used uninitialized in this function [-Wmaybe-uninitialized]
sound/pci/hda/patch_via.c:2108:24: warning: 'dac' may be used uninitialized in this function [-Wmaybe-uninitialized]
sound/pci/lx6464es/lx_core.c:1121:31: warning: 'irqsrc' may be used uninitialized in this function [-Wmaybe-uninitialized]
sound/pci/pcxhr/pcxhr.c:259:25: warning: 'pllreg' may be used uninitialized in this function [-Wmaybe-uninitialized]
sound/pci/pcxhr/pcxhr.c:337:6: warning: 'val' may be used uninitialized in this function [-Wmaybe-uninitialized]
sound/pci/pcxhr/pcxhr.c:342:24: warning: 'realfreq' may be used uninitialized in this function [-Wmaybe-uninitialized]
sound/pci/via82xx.c:2589:2: warning: 'chip' may be used uninitialized in this function [-Wmaybe-uninitialized]
sound/soc/codecs/arizona.c:1367:27: warning: 'aif_tx_state' may be used uninitialized in this function [-Wmaybe-uninitialized]
sound/soc/codecs/arizona.c:1370:21: warning: 'aif_rx_state' may be used uninitialized in this function [-Wmaybe-uninitialized]
sound/soc/codecs/cs35l32.c:329:2: warning: 'val' may be used uninitialized in this function [-Wmaybe-uninitialized]
sound/soc/codecs/wm2000.c:543:6: warning: 'ret' may be used uninitialized in this function [-Wmaybe-uninitialized]
sound/soc/codecs/wm8978.c:814:5: warning: 'diff' may be used uninitialized in this function [-Wuninitialized]
sound/soc/fsl/fsl_ssi.c:715:7: warning: 'baudrate' may be used uninitialized in this function [-Wmaybe-uninitialized]
sound/soc/generic/simple-card.c:476:29: warning: 'flags' may be used uninitialized in this function [-Wuninitialized]
sound/soc/soc-core.c:1768:7: warning: 'compress_type' may be used uninitialized in this function [-Wmaybe-uninitialized]
sound/soc/soc-dapm.c:3125:6: warning: 'ret' may be used uninitialized in this function [-Wmaybe-uninitialized]
sound/usb/caiaq/device.c:494:16: warning: 'card' may be used uninitialized in this function [-Wmaybe-uninitialized]
sound/usb/caiaq/device.h:128:51: warning: 'card' may be used uninitialized in this function [-Wmaybe-uninitialized]
sound/usb/format.c:482:5: warning: 'ret' may be used uninitialized in this function [-Wmaybe-uninitialized]
sound/usb/usbaudio.c:2812:5: warning: 'ret' may be used uninitialized in this function [-Wmaybe-uninitialized]
sound/usb/usx2y/us122l.c:583:15: warning: 'card' may be used uninitialized in this function [-Wmaybe-uninitialized]
sound/usb/usx2y/us122l.h:20:40: warning: 'card' may be used uninitialized in this function [-Wmaybe-uninitialized]
sound/usb/usx2y/usbusx2y.c:390:15: warning: 'card' may be used uninitialized in this function [-Wmaybe-uninitialized]
Thanks,
Fengguang
More information about the Alsa-devel
mailing list