xfer_len is used as argument to dma_unmap_single, so changing it value to one different from dma_map_single will have CONFIG_DMA_API_DEBUG complain. Besides the unmap, xfer_len is only used to compute *actual_len, so do arithmetic only on that to fix the warning. Signed-off-by: Ahmad Fatoum <a.fatoum@xxxxxxxxxxxxxx> --- drivers/usb/dwc2/host.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/dwc2/host.c b/drivers/usb/dwc2/host.c index 344f058be208..a9b25aeeaa11 100644 --- a/drivers/usb/dwc2/host.c +++ b/drivers/usb/dwc2/host.c @@ -209,9 +209,9 @@ static int transfer_chunk(struct dwc2 *dwc2, u8 hc, if (ret < 0) goto exit; - if (in) - xfer_len -= sub; *actual_len = xfer_len; + if (in) + *actual_len -= sub; exit: if (xfer_len) -- 2.39.2