The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] usb: gadget: f_fs: fix __le16 of wMaxPacketSize
@ 2026-06-17  8:59 Ben Dooks
  2026-06-17  9:34 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 3+ messages in thread
From: Ben Dooks @ 2026-06-17  8:59 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Al Viro, Christian Brauner, Sam Day,
	Michael Bommarito, Kees Cook, Ingo Rohloff, linux-usb,
	linux-kernel
  Cc: Ben Dooks

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

Fixes:

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

Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
---
 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] 3+ messages in thread

* Re: [PATCH] usb: gadget: f_fs: fix __le16 of wMaxPacketSize
  2026-06-17  8:59 [PATCH] usb: gadget: f_fs: fix __le16 of wMaxPacketSize Ben Dooks
@ 2026-06-17  9:34 ` Greg Kroah-Hartman
  2026-06-17  9:56   ` Ben Dooks
  0 siblings, 1 reply; 3+ messages in thread
From: Greg Kroah-Hartman @ 2026-06-17  9:34 UTC (permalink / raw)
  To: Ben Dooks
  Cc: Al Viro, Christian Brauner, Sam Day, Michael Bommarito, Kees Cook,
	Ingo Rohloff, linux-usb, linux-kernel

On Wed, Jun 17, 2026 at 09:59:30AM +0100, Ben Dooks wrote:
> The wMaxPacketSize is __le16 type, fix the sparse warnings by changing
> the type.
> 
> Fixes:
> 
> 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
> 
> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
> ---
>  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;

What commit id does this fix?

thanks,

greg k-h

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

* Re: [PATCH] usb: gadget: f_fs: fix __le16 of wMaxPacketSize
  2026-06-17  9:34 ` Greg Kroah-Hartman
@ 2026-06-17  9:56   ` Ben Dooks
  0 siblings, 0 replies; 3+ messages in thread
From: Ben Dooks @ 2026-06-17  9:56 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Al Viro, Christian Brauner, Sam Day, Michael Bommarito, Kees Cook,
	Ingo Rohloff, linux-usb, linux-kernel

On 17/06/2026 10:34, Greg Kroah-Hartman wrote:
> On Wed, Jun 17, 2026 at 09:59:30AM +0100, Ben Dooks wrote:
>> The wMaxPacketSize is __le16 type, fix the sparse warnings by changing
>> the type.
>>
>> Fixes:
>>
>> 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
>>
>> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
>> ---
>>   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;
> 
> What commit id does this fix?

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


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

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

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

end of thread, other threads:[~2026-06-17  9:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-17  8:59 [PATCH] usb: gadget: f_fs: fix __le16 of wMaxPacketSize Ben Dooks
2026-06-17  9:34 ` Greg Kroah-Hartman
2026-06-17  9:56   ` Ben Dooks

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