[PATCH 3/3] usb: gadget: udc-xilinx: fix incorrect type in assignment warning

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

 



The bitwise attribute is used by the sparse utility to make sure the
variable is converted to the local processor type before other (unsafe)
operations are performed on the variable. Fix the below sparse warnings
type casted with __le16:

warning: incorrect type in assignment (different base types)
   expected unsigned short [usertype]
   got restricted __le16 [usertype]

Reported-by: kernel test robot <lkp@xxxxxxxxx>
Closes: https://lore.kernel.org/all/202209020044.CX2PfZzM-lkp@xxxxxxxxx/
Signed-off-by: Piyush Mehta <piyush.mehta@xxxxxxx>
---
 drivers/usb/gadget/udc/udc-xilinx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/udc/udc-xilinx.c b/drivers/usb/gadget/udc/udc-xilinx.c
index 476c0a8fc5e7..0b12155635d9 100644
--- a/drivers/usb/gadget/udc/udc-xilinx.c
+++ b/drivers/usb/gadget/udc/udc-xilinx.c
@@ -1638,7 +1638,7 @@ static void xudc_getstatus(struct xusb_udc *udc)
 	}
 
 	req->usb_req.length = 2;
-	*(u16 *)req->usb_req.buf = cpu_to_le16(status);
+	*(__le16 *)req->usb_req.buf = cpu_to_le16(status);
 	ret = __xudc_ep0_queue(ep0, req);
 	if (ret == 0)
 		return;
-- 
2.17.1




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

  Powered by Linux