[PATCH V2] usb: lvstest: Fix sparse warnings generated by kbuild test bot

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

 



Following sparse warnings were reported by kbuild test bot

drivers/usb/misc/lvstest.c:314:28: sparse: incorrect type in assignment (different base types)
   drivers/usb/misc/lvstest.c:314:28:    expected unsigned short [unsigned] [usertype] portchange
   drivers/usb/misc/lvstest.c:314:28:    got restricted __le16 [usertype] wPortChange
drivers/usb/misc/lvstest.c:332:40: sparse: restricted __le16 degrades to integer

This patch fixes above warnings.

Signed-off-by: Pratyush Anand <pratyush.anand@xxxxxx>
---
 drivers/usb/misc/lvstest.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/misc/lvstest.c b/drivers/usb/misc/lvstest.c
index 02df9a7..7d589c1 100644
--- a/drivers/usb/misc/lvstest.c
+++ b/drivers/usb/misc/lvstest.c
@@ -311,7 +311,7 @@ static void lvs_rh_work(struct work_struct *work)
 		if (ret < 4)
 			continue;
 
-		portchange = port_status->wPortChange;
+		portchange = le16_to_cpu(port_status->wPortChange);
 
 		if (portchange & USB_PORT_STAT_C_LINK_STATE)
 			lvs_rh_clear_port_feature(hdev, i,
@@ -329,7 +329,7 @@ static void lvs_rh_work(struct work_struct *work)
 			lvs_rh_clear_port_feature(hdev, i,
 					USB_PORT_FEAT_C_CONNECTION);
 
-			if (port_status->wPortStatus &
+			if (le16_to_cpu(port_status->wPortStatus) &
 					USB_PORT_STAT_CONNECTION) {
 				lvs->present = true;
 				lvs->portnum = i;
-- 
1.8.1.2

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




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

  Powered by Linux