summaryrefslogtreecommitdiff
path: root/drivers/fpga
diff options
context:
space:
mode:
authorMichael Walle <michael@walle.cc>2021-02-11 00:42:29 +0300
committerMichal Simek <michal.simek@xilinx.com>2021-02-23 16:56:55 +0300
commit8c02d842b61ebd579e42ff3f0326457e7d10ec95 (patch)
tree5b920675cd673a9a130af76ce8dce249864bfd63 /drivers/fpga
parent038e02455bbc18d34946fdfe77faf2062adc3e2a (diff)
downloadu-boot-8c02d842b61ebd579e42ff3f0326457e7d10ec95.tar.xz
fpga: zynqpl: fix buffer alignment
Due to pointer arithmetic, "sizeof(u32) * ARCH_DMA_MINALIGN" is subtracted. It seems that the original intention was to just subtract ARCH_DMA_MINALIGN. Fix it. Signed-off-by: Michael Walle <michael@walle.cc> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Diffstat (limited to 'drivers/fpga')
-rw-r--r--drivers/fpga/zynqpl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/fpga/zynqpl.c b/drivers/fpga/zynqpl.c
index a11e485525..2de40109a8 100644
--- a/drivers/fpga/zynqpl.c
+++ b/drivers/fpga/zynqpl.c
@@ -315,7 +315,7 @@ static u32 *zynq_align_dma_buffer(u32 *buf, u32 len, u32 swap)
if (new_buf > buf) {
debug("%s: Aligned buffer is after buffer start\n",
__func__);
- new_buf -= ARCH_DMA_MINALIGN;
+ new_buf = (u32 *)((u32)new_buf - ARCH_DMA_MINALIGN);
}
printf("%s: Align buffer at %x to %x(swap %d)\n", __func__,
(u32)buf, (u32)new_buf, swap);