Re: [PATCH] usb/core: usb_alloc_dev(): fix setting of ->portnum

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

 



Hi Nicolai,

[auto build test WARNING on next-20160317]
[cannot apply to v4.5-rc7 v4.5-rc6 v4.5-rc5 v4.5]
[if your patch is applied to the wrong git tree, please drop us a note to help improving the system]

url:    https://github.com/0day-ci/linux/commits/Nicolai-Stange/usb-core-usb_alloc_dev-fix-setting-of-portnum/20160318-062419
config: i386-randconfig-x017-201611 (attached as .config)
reproduce:
        # 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/usb/core/usb.c: In function 'usb_alloc_dev':
>> drivers/usb/core/usb.c:505:22: warning: 'raw_port' may be used uninitialized in this function [-Wmaybe-uninitialized]
      dev->dev.of_node = usb_of_get_child_node(parent->dev.of_node,
                         ^

vim +/raw_port +505 drivers/usb/core/usb.c

4a0cd967 Sarah Sharp    2009-09-04  489  			if (port1 < 15)
7206b001 Sarah Sharp    2009-04-27  490  				dev->route = parent->route +
7206b001 Sarah Sharp    2009-04-27  491  					(port1 << ((parent->level - 1)*4));
4a0cd967 Sarah Sharp    2009-09-04  492  			else
4a0cd967 Sarah Sharp    2009-09-04  493  				dev->route = parent->route +
4a0cd967 Sarah Sharp    2009-09-04  494  					(15 << ((parent->level - 1)*4));
7206b001 Sarah Sharp    2009-04-27  495  		}
^1da177e Linus Torvalds 2005-04-16  496  
^1da177e Linus Torvalds 2005-04-16  497  		dev->dev.parent = &parent->dev;
0031a06e Kay Sievers    2008-05-02  498  		dev_set_name(&dev->dev, "%d-%s", bus->busnum, dev->devpath);
^1da177e Linus Torvalds 2005-04-16  499  
69bec725 Peter Chen     2016-02-19  500  		if (!parent->parent) {
69bec725 Peter Chen     2016-02-19  501  			/* device under root hub's port */
23f4c0b9 Nicolai Stange 2016-03-17  502  			raw_port = usb_hcd_find_raw_port_number(usb_hcd,
69bec725 Peter Chen     2016-02-19  503  				port1);
69bec725 Peter Chen     2016-02-19  504  		}
69bec725 Peter Chen     2016-02-19 @505  		dev->dev.of_node = usb_of_get_child_node(parent->dev.of_node,
23f4c0b9 Nicolai Stange 2016-03-17  506  				raw_port);
69bec725 Peter Chen     2016-02-19  507  
^1da177e Linus Torvalds 2005-04-16  508  		/* hub driver sets up TT records */
^1da177e Linus Torvalds 2005-04-16  509  	}
^1da177e Linus Torvalds 2005-04-16  510  
12c3da34 Alan Stern     2005-11-23  511  	dev->portnum = port1;
^1da177e Linus Torvalds 2005-04-16  512  	dev->bus = bus;
^1da177e Linus Torvalds 2005-04-16  513  	dev->parent = parent;

:::::: The code at line 505 was first introduced by commit
:::::: 69bec725985324e79b1c47ea287815ac4ddb0521 USB: core: let USB device know device node

:::::: TO: Peter Chen <peter.chen@xxxxxxxxxxxxx>
:::::: CC: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

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

Attachment: .config.gz
Description: Binary data


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux