[spi:for-4.21 40/40] drivers/spi/spi-npcm-pspi.c:226:17: warning: 'val' may be used uninitialized in this function

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

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-4.21
head:   2a22f1b30cee8d1e104a6c5062a609bedbfd5c39
commit: 2a22f1b30cee8d1e104a6c5062a609bedbfd5c39 [40/40] spi: npcm: add NPCM PSPI controller driver
config: i386-allmodconfig (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
        git checkout 2a22f1b30cee8d1e104a6c5062a609bedbfd5c39
        # save the attached .config to linux build tree
        make ARCH=i386 

Note: it may well be a FALSE warning. FWIW you are at least aware of it now.
http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings

All warnings (new ones prefixed by >>):

   drivers/spi/spi-npcm-pspi.c: In function 'npcm_pspi_handler':
>> drivers/spi/spi-npcm-pspi.c:226:17: warning: 'val' may be used uninitialized in this function [-Wmaybe-uninitialized]
      *priv->rx_buf = val;
      ~~~~~~~~~~~~~~^~~~~
   drivers/spi/spi-npcm-pspi.c:215:6: note: 'val' was declared here
     u16 val;
         ^~~

vim +/val +226 drivers/spi/spi-npcm-pspi.c

   211	
   212	static void npcm_pspi_recv(struct npcm_pspi *priv)
   213	{
   214		int rsize;
   215		u16 val;
   216	
   217		rsize = min(bytes_per_word(priv->bits_per_word), priv->rx_bytes);
   218		priv->rx_bytes -= rsize;
   219	
   220		if (priv->rx_buf) {
   221			if (rsize == 1)
   222				val = ioread8(priv->base + NPCM_PSPI_DATA);
   223			if (rsize == 2)
   224				val = ioread16(priv->base + NPCM_PSPI_DATA);
   225	
 > 226			*priv->rx_buf = val;
   227			priv->rx_buf += rsize;
   228		}
   229	}
   230	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux