Skip to content

Commit d5ab95d

Browse files
andy-shevgregkh
authored andcommitted
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: ae8a2ca ("usb: typec: Group all TCPCI/TCPM code together") Fixes: 3c4fb9f ("usb: typec: wcove: start using tcpm for USB PD support") Reported-by: kernel test robot <[email protected]> Reviewed-by: Heikki Krogerus <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent fbf649c commit d5ab95d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/usb/typec/tcpm/wcove.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ static int wcove_pd_transmit(struct tcpc_dev *tcpc,
378378
const u8 *data = (void *)msg;
379379
int i;
380380

381-
for (i = 0; i < pd_header_cnt(msg->header) * 4 + 2; i++) {
381+
for (i = 0; i < pd_header_cnt_le(msg->header) * 4 + 2; i++) {
382382
ret = regmap_write(wcove->regmap, USBC_TX_DATA + i,
383383
data[i]);
384384
if (ret)

0 commit comments

Comments
 (0)