diff options
author | Piyush Mehta <piyush.mehta@amd.com> | 2023-08-22 08:32:00 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-08-22 14:46:45 +0200 |
commit | 0411fa8a5f655ebc0753e718fdfe68bc66a756f0 (patch) | |
tree | 86325777e710ec6b1e0875d8b95cfbad25891b2e /drivers/usb | |
parent | usb: gadget: udc-xilinx: fix restricted __le16 degrades to integer warning (diff) | |
download | linux-0411fa8a5f655ebc0753e718fdfe68bc66a756f0.tar.xz linux-0411fa8a5f655ebc0753e718fdfe68bc66a756f0.zip |
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>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/gadget/udc/udc-xilinx.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/usb/gadget/udc/udc-xilinx.c b/drivers/usb/gadget/udc/udc-xilinx.c index e5029dd3becd..eb06b4234267 100644 --- a/drivers/usb/gadget/udc/udc-xilinx.c +++ b/drivers/usb/gadget/udc/udc-xilinx.c @@ -1755,9 +1755,9 @@ static void xudc_handle_setup(struct xusb_udc *udc) memcpy(&setup, ep0rambase, 8); udc->setup = setup; - udc->setup.wValue = cpu_to_le16(setup.wValue); - udc->setup.wIndex = cpu_to_le16(setup.wIndex); - udc->setup.wLength = cpu_to_le16(setup.wLength); + udc->setup.wValue = cpu_to_le16((u16 __force)setup.wValue); + udc->setup.wIndex = cpu_to_le16((u16 __force)setup.wIndex); + udc->setup.wLength = cpu_to_le16((u16 __force)setup.wLength); /* Clear previous requests */ xudc_nuke(ep0, -ECONNRESET); |