dmaengine: stm32-dma: fix stm32_dma_get_max_width
authorAmelie Delaunay <amelie.delaunay@foss.st.com>
Mon, 11 Oct 2021 09:42:58 +0000 (11:42 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Nov 2021 18:17:02 +0000 (19:17 +0100)
commitb07aa21474d3e6c84eb4e3838b6f3da0789f4fdb
tree2a3a1441676cc6c72a6b4ecf7b44ae5d50c99e7e
parentf12d23bc255d7de760902050df200d0edd3db319
dmaengine: stm32-dma: fix stm32_dma_get_max_width

[ Upstream commit b20fd5fa310cbf7ec367f263a34382a24c4cee73 ]

buf_addr parameter of stm32_dma_set_xfer_param function is a dma_addr_t.
We only need to check the remainder of buf_addr/max_width, so, no need to
use do_div and extra u64 addr. Use '%' instead.

Fixes: e0ebdbdcb42a ("dmaengine: stm32-dma: take address into account when computing max width")
Signed-off-by: Amelie Delaunay <amelie.delaunay@foss.st.com>
Link: https://lore.kernel.org/r/20211011094259.315023-3-amelie.delaunay@foss.st.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/dma/stm32-dma.c