]> git.baikalelectronics.ru Git - kernel.git/commit
usb: typec: wcove: Use LE to CPU conversion when accessing msg->header
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Wed, 9 Jun 2021 17:22:02 +0000 (20:22 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Jun 2021 18:01:23 +0000 (20:01 +0200)
commit340ab60bf0a9ff45ea0ffda0daef64a5a52d35e8
tree1bff9cf9efdf57b1986f8122d4c6769145abfdd2
parentc727c672bc3cae8563ca1c4b9f7717b7d14381a0
usb: typec: wcove: Use LE to CPU conversion when accessing msg->header

As LKP noticed the Sparse is not happy about strict type handling:
   .../typec/tcpm/wcove.c:380:50: sparse:     expected unsigned short [usertype] header
   .../typec/tcpm/wcove.c:380:50: sparse:     got restricted __le16 const [usertype] header

Fix this by switching to use pd_header_cnt_le() instead of pd_header_cnt()
in the affected code.

Fixes: 6cc42660aa3f ("usb: typec: Group all TCPCI/TCPM code together")
Fixes: 5e8078e1573b ("usb: typec: wcove: start using tcpm for USB PD support")
Reported-by: kernel test robot <lkp@intel.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20210609172202.83377-1-andriy.shevchenko@linux.intel.com
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/typec/tcpm/wcove.c