Skip to contentSkip to conversation

usb: gadget: f_fs: fix __le16 of wMaxPacketSize

PATCH Superseded Ben Dooks 2 participants 4 messages Jul 10 – Jul 13 USB

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Ben Dooks

author
#0 lore raw

PATCH v2 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 dcc03cef0fd8 ("usb: gadget: f_fs: preserve wMaxPacketSize across usb_ep_autoconfig() call")

---
v2:
- add fixes tag and reword commit message

---
 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 75912ce6ab55..35d885178b52 100644
@@ -3332,7 +3332,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
#1 lore raw
Quoted 11 lines · Ben Dooks

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

Quoted 1 line
Fixes dcc03cef0fd8 ("usb: gadget: f_fs: preserve wMaxPacketSize across usb_ep_autoconfig() call")

This isn't a valid git id :(

author
#2 lore raw
Quoted 12 lines · Greg Kroah-Hartman
Quoted 11 lines · Ben Dooks

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

Quoted 3 lines
Quoted 1 line
Fixes dcc03cef0fd8 ("usb: gadget: f_fs: preserve wMaxPacketSize across usb_ep_autoconfig() call")

This isn't a valid git id :(

Looks like the b got dropped off the front during copy.

Fixes bdcc03cef0fd8 ("usb: gadget: f_fs: preserve wMaxPacketSize across

usb_ep_autoconfig() call")

commit bdcc03cef0fd8abc6eaeec6ac47e54ae8f8c625f

Author: Andrzej Pietrasiewicz <[email protected]>
Date:   Thu Jan 31 15:53:40 2019 +0100

usb: gadget: f_fs: preserve wMaxPacketSize across
usb_ep_autoconfig() call

usb_ep_autoconfig() treats the passed descriptor as if it were an fs descriptor. In particular, for bulk endpoints, it clips wMaxPacketSize to 64. This patch preserves the original value.

Signature · 4 lines
Ben Dooks				http://www.codethink.co.uk/
Senior Engineer				Codethink - Providing Genius

https://www.codethink.co.uk/privacy.html
#3 lore raw
Quoted 29 lines · Ben Dooks
Quoted 12 lines · Greg Kroah-Hartman
Quoted 11 lines · Ben Dooks

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

Quoted 3 lines
Quoted 1 line
Fixes dcc03cef0fd8 ("usb: gadget: f_fs: preserve wMaxPacketSize across usb_ep_autoconfig() call")

This isn't a valid git id :(

Looks like the b got dropped off the front during copy.

Fixes bdcc03cef0fd8 ("usb: gadget: f_fs: preserve wMaxPacketSize across

usb_ep_autoconfig() call")

commit bdcc03cef0fd8abc6eaeec6ac47e54ae8f8c625f

Author: Andrzej Pietrasiewicz <[email protected]>
Date:   Thu Jan 31 15:53:40 2019 +0100

usb: gadget: f_fs: preserve wMaxPacketSize across usb_ep_autoconfig()
call

Quoted 8 lines

usb_ep_autoconfig() treats the passed descriptor as if it were an fs descriptor. In particular, for bulk endpoints, it clips wMaxPacketSize to 64. This patch preserves the original value.

Great, please fix this up and resend.

thanks,

greg k-h