Re: [PATCH] USB: Don't enable LPM if it's already enabled

From: kbuild test robot
Date: Tue Oct 30 2018 - 02:31:25 EST


Hi Kai-Heng,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on usb/usb-testing]
[also build test WARNING on v4.19 next-20181029]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url: https://github.com/0day-ci/linux/commits/Kai-Heng-Feng/USB-Don-t-enable-LPM-if-it-s-already-enabled/20181030-135717
base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing
config: i386-randconfig-x074-201843 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
# save the attached .config to linux build tree
make ARCH=i386

All warnings (new ones prefixed by >>):

drivers/usb//core/driver.c: In function 'usb_set_usb2_hardware_lpm':
>> drivers/usb//core/driver.c:1904:13: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
if (enable && !udev->usb2_hw_lpm_allowed ||
~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

vim +1904 drivers/usb//core/driver.c

1898
1899 int usb_set_usb2_hardware_lpm(struct usb_device *udev, int enable)
1900 {
1901 struct usb_hcd *hcd = bus_to_hcd(udev->bus);
1902 int ret = -EPERM;
1903
> 1904 if (enable && !udev->usb2_hw_lpm_allowed ||
1905 udev->usb2_hw_lpm_enabled == enable)
1906 return 0;
1907
1908 if (hcd->driver->set_usb2_hw_lpm) {
1909 ret = hcd->driver->set_usb2_hw_lpm(hcd, udev, enable);
1910 if (!ret)
1911 udev->usb2_hw_lpm_enabled = enable;
1912 }
1913
1914 return ret;
1915 }
1916

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

Attachment: .config.gz
Description: application/gzip