Skip to contentSkip to conversation

usb: gadget: f_fs: fix __le16 of wMaxPacketSize

PATCH New Ben Dooks 1 participant 1 message Jul 13 USB

lore
Share & tools
lore

Ben Dooks

author
#0 lore raw

PATCH v3 1/1 usb: gadget: f_fs: fix __le16 of wMaxPacketSize

The wMaxPacketSize is __le16 type, fix the sparse warnings by changing the type.

Fixes the following sparse warnings:
drivers/usb/gadget/function/f_fs.c:3346:32: warning: incorrect type in assignment (different base types)
drivers/usb/gadget/function/f_fs.c:3346:32: expected unsigned short [usertype] wMaxPacketSize
drivers/usb/gadget/function/f_fs.c:3346:32: got restricted __le16 [usertype] wMaxPacketSize
drivers/usb/gadget/function/f_fs.c:3371:36: warning: incorrect type in assignment (different base types)
drivers/usb/gadget/function/f_fs.c:3371:36: expected restricted __le16 [usertype] wMaxPacketSize
drivers/usb/gadget/function/f_fs.c:3371:36: got unsigned short [usertype] wMaxPacketSize

Fixes bdcc03cef0fd8 ("usb: gadget: f_fs: preserve wMaxPacketSize across usb_ep_autoconfig() call")

---
v2:
- add fixes tag and reword commit message
v3:
- fix mis-copied git-id for the fixes

---
 drivers/usb/gadget/function/f_fs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/gadget/function/f_fs.c +1 -1
index 44218be1e676..68114278a150 100644
@@ -3335,7 +3335,7 @@ static int __ffs_func_bind_do_descs(enum ffs_entity_type type, u8 *valuep,
 		struct usb_request *req;
 		struct usb_ep *ep;
 		u8 bEndpointAddress;
-		u16 wMaxPacketSize;
+		__le16 wMaxPacketSize;
 
 		/*
 		 * We back up bEndpointAddress because autoconfig overwrites
Signature · 1 line
2.37.2.352.g3c44437643