Skip to content

Commit

Permalink
Revert "usb: gadget: udc-xilinx: replace memcpy with memcpy_toio"
Browse files Browse the repository at this point in the history
[ Upstream commit fe0a2ac ]

This reverts commit 8cb339f as it
throws up a bunch of sparse warnings as reported by the kernel test
robot.

Reported-by: kernel test robot <lkp@intel.com>
Link: https://lore.kernel.org/r/202209020044.CX2PfZzM-lkp@intel.com
Fixes: 8cb339f ("usb: gadget: udc-xilinx: replace memcpy with memcpy_toio")
Cc: stable@vger.kernel.org
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Piyush Mehta <piyush.mehta@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
gregkh committed Sep 28, 2022
1 parent 8039621 commit 2776911
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions drivers/usb/gadget/udc/udc-xilinx.c
Original file line number Diff line number Diff line change
Expand Up @@ -499,11 +499,11 @@ static int xudc_eptxrx(struct xusb_ep *ep, struct xusb_req *req,
/* Get the Buffer address and copy the transmit data.*/
eprambase = (u32 __force *)(udc->addr + ep->rambase);
if (ep->is_in) {
memcpy_toio(eprambase, bufferptr, bytestosend);
memcpy(eprambase, bufferptr, bytestosend);
udc->write_fn(udc->addr, ep->offset +
XUSB_EP_BUF0COUNT_OFFSET, bufferlen);
} else {
memcpy_toio(bufferptr, eprambase, bytestosend);
memcpy(bufferptr, eprambase, bytestosend);
}
/*
* Enable the buffer for transmission.
Expand All @@ -517,11 +517,11 @@ static int xudc_eptxrx(struct xusb_ep *ep, struct xusb_req *req,
eprambase = (u32 __force *)(udc->addr + ep->rambase +
ep->ep_usb.maxpacket);
if (ep->is_in) {
memcpy_toio(eprambase, bufferptr, bytestosend);
memcpy(eprambase, bufferptr, bytestosend);
udc->write_fn(udc->addr, ep->offset +
XUSB_EP_BUF1COUNT_OFFSET, bufferlen);
} else {
memcpy_toio(bufferptr, eprambase, bytestosend);
memcpy(bufferptr, eprambase, bytestosend);
}
/*
* Enable the buffer for transmission.
Expand Down Expand Up @@ -1023,7 +1023,7 @@ static int __xudc_ep0_queue(struct xusb_ep *ep0, struct xusb_req *req)
udc->addr);
length = req->usb_req.actual = min_t(u32, length,
EP0_MAX_PACKET);
memcpy_toio(corebuf, req->usb_req.buf, length);
memcpy(corebuf, req->usb_req.buf, length);
udc->write_fn(udc->addr, XUSB_EP_BUF0COUNT_OFFSET, length);
udc->write_fn(udc->addr, XUSB_BUFFREADY_OFFSET, 1);
} else {
Expand Down Expand Up @@ -1752,7 +1752,7 @@ static void xudc_handle_setup(struct xusb_udc *udc)

/* Load up the chapter 9 command buffer.*/
ep0rambase = (u32 __force *) (udc->addr + XUSB_SETUP_PKT_ADDR_OFFSET);
memcpy_toio(&setup, ep0rambase, 8);
memcpy(&setup, ep0rambase, 8);

udc->setup = setup;
udc->setup.wValue = cpu_to_le16(setup.wValue);
Expand Down Expand Up @@ -1839,7 +1839,7 @@ static void xudc_ep0_out(struct xusb_udc *udc)
(ep0->rambase << 2));
buffer = req->usb_req.buf + req->usb_req.actual;
req->usb_req.actual = req->usb_req.actual + bytes_to_rx;
memcpy_toio(buffer, ep0rambase, bytes_to_rx);
memcpy(buffer, ep0rambase, bytes_to_rx);

if (req->usb_req.length == req->usb_req.actual) {
/* Data transfer completed get ready for Status stage */
Expand Down Expand Up @@ -1915,7 +1915,7 @@ static void xudc_ep0_in(struct xusb_udc *udc)
(ep0->rambase << 2));
buffer = req->usb_req.buf + req->usb_req.actual;
req->usb_req.actual = req->usb_req.actual + length;
memcpy_toio(ep0rambase, buffer, length);
memcpy(ep0rambase, buffer, length);
}
udc->write_fn(udc->addr, XUSB_EP_BUF0COUNT_OFFSET, count);
udc->write_fn(udc->addr, XUSB_BUFFREADY_OFFSET, 1);
Expand Down

0 comments on commit 2776911

Please sign in to comment.