[pci:pci/enumeration 1/2] drivers/pci/probe.c:1563:5: warning: 'pos' 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/helgaas/pci.git pci/enumeration
head:   b865d8231143ce468e626a04ae01d7cb2f738414
commit: 6ddcfe9b7717d8f0a3a22382eaf27aae00958696 [1/2] PCI: Apply _HPX settings only to relevant devices
config: i386-randconfig-x007-201702 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
        git checkout 6ddcfe9b7717d8f0a3a22382eaf27aae00958696
        # 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/pci/probe.c: In function 'program_hpp_type1':
   drivers/pci/probe.c:1562:6: warning: 'return' with a value, in function returning void
     pos = pci_find_capability(dev, PCI_CAP_ID_PCIX);
     ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/pci/probe.c:1555:13: note: declared here
    static void program_hpp_type1(struct pci_dev *dev, struct hpp_type1 *hpp)
                ^~~~~~~~~~~~~~~~~
   drivers/pci/probe.c: In function 'pci_device_add':
>> drivers/pci/probe.c:1563:5: warning: 'pos' may be used uninitialized in this function [-Wmaybe-uninitialized]
     if (!pos)
        ^
   drivers/pci/probe.c:1557:6: note: 'pos' was declared here
     int pos;
         ^~~

vim +/pos +1563 drivers/pci/probe.c

  1556	{
  1557		int pos;
  1558	
  1559		if (!hpp)
  1560			return
  1561	
> 1562		pos = pci_find_capability(dev, PCI_CAP_ID_PCIX);
> 1563		if (!pos)
  1564			return;
  1565	
  1566		dev_warn(&dev->dev, "PCI-X settings not supported\n");

---
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]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux