Re: [PATCH v2] usb: gadget: f_fs: fix __le16 of wMaxPacketSize

From: Ben Dooks

Date: Mon Jul 13 2026 - 02:02:17 EST


On 11/07/2026 06:09, Greg Kroah-Hartman wrote:
On Fri, Jul 10, 2026 at 03:54:30PM +0100, Ben Dooks wrote:
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")

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 <andrzej.p@xxxxxxxxxxxxx>
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.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@xxxxxxxxxxxxx>
Signed-off-by: Felipe Balbi <felipe.balbi@xxxxxxxxxxxxxxx>



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

https://www.codethink.co.uk/privacy.html