Skip to contentSkip to conversation

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

PATCH In review Dhruva Gole 2 participants 3 messages Sep 20, 2022 – Oct 7, 2022 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): k3-udma-fix

#1 lore raw

PATCH 1/1 dma: ti: k3-udma: Fix 'SZ_64K’ undeclared error

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

---

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(+)
drivers/dma/ti/k3-udma.c +1 -0
index 86603d43f14f..1a9197bfc820 100644
@@ -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>
Signature · 1 line
2.25.1