Linux USB
 help / color / mirror / Atom feed
* [PATCH v2] usb: gadget: f_fs: fix __le16 of wMaxPacketSize
@ 2026-07-10 14:54 Ben Dooks
  2026-07-11  5:09 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 4+ messages in thread
From: Ben Dooks @ 2026-07-10 14:54 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Al Viro, Michael Bommarito, Sam Day,
	Kees Cook, Ben Dooks, linux-usb, linux-kernel

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")
Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
---
v2:
  - add fixes tag and reword commit message
---
 drivers/usb/gadget/function/f_fs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c
index 75912ce6ab55..35d885178b52 100644
--- a/drivers/usb/gadget/function/f_fs.c
+++ b/drivers/usb/gadget/function/f_fs.c
@@ -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
-- 
2.37.2.352.g3c44437643


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] usb: gadget: f_fs: fix __le16 of wMaxPacketSize
  2026-07-10 14:54 [PATCH v2] usb: gadget: f_fs: fix __le16 of wMaxPacketSize Ben Dooks
@ 2026-07-11  5:09 ` Greg Kroah-Hartman
  2026-07-13  6:00   ` Ben Dooks
  0 siblings, 1 reply; 4+ messages in thread
From: Greg Kroah-Hartman @ 2026-07-11  5:09 UTC (permalink / raw)
  To: Ben Dooks
  Cc: Al Viro, Michael Bommarito, Sam Day, Kees Cook, linux-usb,
	linux-kernel

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 :(


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] usb: gadget: f_fs: fix __le16 of wMaxPacketSize
  2026-07-11  5:09 ` Greg Kroah-Hartman
@ 2026-07-13  6:00   ` Ben Dooks
  2026-07-13  6:17     ` Greg Kroah-Hartman
  0 siblings, 1 reply; 4+ messages in thread
From: Ben Dooks @ 2026-07-13  6:00 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Al Viro, Michael Bommarito, Sam Day, Kees Cook, linux-usb,
	linux-kernel

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@collabora.com>
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@collabora.com>
     Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>



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

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] usb: gadget: f_fs: fix __le16 of wMaxPacketSize
  2026-07-13  6:00   ` Ben Dooks
@ 2026-07-13  6:17     ` Greg Kroah-Hartman
  0 siblings, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2026-07-13  6:17 UTC (permalink / raw)
  To: Ben Dooks
  Cc: Al Viro, Michael Bommarito, Sam Day, Kees Cook, linux-usb,
	linux-kernel

On Mon, Jul 13, 2026 at 07:00:30AM +0100, Ben Dooks wrote:
> 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@collabora.com>
> 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@collabora.com>
>     Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
> 
> 

Great, please fix this up and resend.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-07-13  6:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-10 14:54 [PATCH v2] usb: gadget: f_fs: fix __le16 of wMaxPacketSize Ben Dooks
2026-07-11  5:09 ` Greg Kroah-Hartman
2026-07-13  6:00   ` Ben Dooks
2026-07-13  6:17     ` Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox