Skip to content

Commit 0411fa8

Browse files
PiyushXilinxgregkh
authored andcommitted
usb: gadget: udc-xilinx: fix cast from restricted __le16 warning
usb_ctrlrequest member wValue, wLength and wIndex are of type __le16, conversion macro cpu_to_le16() input argument is __u16, so properly typecasted to fix the cast from restricted __le16 warning. Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/all/202209020044.CX2PfZzM-lkp@intel.com/ Signed-off-by: Piyush Mehta <piyush.mehta@amd.com> Link: https://lore.kernel.org/r/20230822063201.16929-3-piyush.mehta@amd.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 7f93e68 commit 0411fa8

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

drivers/usb/gadget/udc/udc-xilinx.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1755,9 +1755,9 @@ static void xudc_handle_setup(struct xusb_udc *udc)
17551755
memcpy(&setup, ep0rambase, 8);
17561756

17571757
udc->setup = setup;
1758-
udc->setup.wValue = cpu_to_le16(setup.wValue);
1759-
udc->setup.wIndex = cpu_to_le16(setup.wIndex);
1760-
udc->setup.wLength = cpu_to_le16(setup.wLength);
1758+
udc->setup.wValue = cpu_to_le16((u16 __force)setup.wValue);
1759+
udc->setup.wIndex = cpu_to_le16((u16 __force)setup.wIndex);
1760+
udc->setup.wLength = cpu_to_le16((u16 __force)setup.wLength);
17611761

17621762
/* Clear previous requests */
17631763
xudc_nuke(ep0, -ECONNRESET);

0 commit comments

Comments
 (0)