[PATCH] dma: ti: k3-udma: Fix 'SZ_64K’ undeclared error

Dhruva Gole d-gole at ti.com
Tue Sep 20 07:26:02 CEST 2022


Include linux/sizes.h because it defines SZ_64K which is used in many
places inside k3-udma.c
This fixes the error: ‘SZ_64K’ undeclared which appears during build
time

Signed-off-by: Dhruva Gole <d-gole at ti.com>
---

I came across this error while trying to build upstream u-boot for the
AM62x. I needed to enable udma for xSPI boot and I got the following
build errors:

../drivers/dma/ti/k3-udma.c: In function ‘udma_prep_dma_memcpy’:

../drivers/dma/ti/k3-udma.c:1849:12: error: ‘SZ_64K’ undeclared (first
use in this function)

 1849 | if (len < SZ_64K) {

     |           ^~~~~~

This probably went unnoticed until now because it was being included in
all the include/config/xx_evm.h files. However it being absent from
upstream am62_evm.h landed me this error and I think it makes sense to
actually add the include sizes.h here itself rather than rely that some
other included file that is included in k3-udma  will include it in
itself.

Thanks and Regards,
Dhruva Gole

 drivers/dma/ti/k3-udma.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/dma/ti/k3-udma.c b/drivers/dma/ti/k3-udma.c
index 86603d43f14f..1a9197bfc820 100644
--- a/drivers/dma/ti/k3-udma.c
+++ b/drivers/dma/ti/k3-udma.c
@@ -14,6 +14,7 @@
 #include <malloc.h>
 #include <linux/bitops.h>
 #include <linux/dma-mapping.h>
+#include <linux/sizes.h>
 #include <dm.h>
 #include <dm/device_compat.h>
 #include <dm/devres.h>
-- 
2.25.1



More information about the U-Boot mailing list