Skip to contentSkip to conversation

usb: renesas_usbhs: fix type of buf

PATCH In review Ben Dooks (Codethink) 2 participants 2 messages Oct 15, 2019 – Oct 16, 2019 USB

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usb: renesas_usbhs: fix type of buf

Fix the type of buf in __usbhsg_recip_send_status to be __le16 to avoid the following sparse warning:

drivers/usb/renesas_usbhs/mod_gadget.c:335:14: warning: incorrect type in assignment (different base types)
drivers/usb/renesas_usbhs/mod_gadget.c:335:14: expected unsigned short
drivers/usb/renesas_usbhs/mod_gadget.c:335:14: got restricted __le16 [usertype]

---
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Yoshihiro Shimoda <[email protected]>
Cc: [email protected]
Cc: [email protected]

---
 drivers/usb/renesas_usbhs/mod_gadget.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/renesas_usbhs/mod_gadget.c +1 -1
index e5ef56991dba..0b8a2920de10 100644
@@ -315,7 +315,7 @@ static void __usbhsg_recip_send_status(struct usbhsg_gpriv *gpriv,
 	struct usbhs_pipe *pipe = usbhsg_uep_to_pipe(dcp);
 	struct device *dev = usbhsg_gpriv_to_dev(gpriv);
 	struct usb_request *req;
-	unsigned short *buf;
+	__le16 *buf;
 
 	/* alloc new usb_request for recip */
 	req = usb_ep_alloc_request(&dcp->ep, GFP_ATOMIC);
Signature · 1 line
2.23.0
Reviewed-by on v1 1/1
#1 lore raw

Hi Ben,

Quoted 10 lines

From: Ben Dooks (Codethink), Sent: Wednesday, October 16, 2019 12:30 AM

Fix the type of buf in __usbhsg_recip_send_status to be __le16 to avoid the following sparse warning:

drivers/usb/renesas_usbhs/mod_gadget.c:335:14: warning: incorrect type in assignment (different base types)
drivers/usb/renesas_usbhs/mod_gadget.c:335:14: expected unsigned short
drivers/usb/renesas_usbhs/mod_gadget.c:335:14: got restricted __le16 [usertype]

Thank you for the patch!

I also found a parse warning in the usbhsg_recip_handler_std_set_device(). So, I'll make a patch to fix the warning.

Best regards,
Yoshihiro Shimoda