dma: ti: k3-udma: Fix 'SZ_64K’ undeclared error
Subsystems (2)
PATCH 1/1 dma: ti: k3-udma: Fix 'SZ_64K’ undeclared error
In reply to a message not in the archiveInclude 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
@@ -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
Quoted 6 lines · Dhruva Gole
Include
linux/sizes.hbecause it definesSZ_64Kwhich is used in many places insidek3-udma.c
This fixes the error: ‘SZ_64K’ undeclared which appears during build timeSigned-off-by Dhruva Gole <[email protected]>
Signature · 1 line
Tom
Quoted 7 lines · Dhruva Gole
Include
linux/sizes.hbecause it definesSZ_64Kwhich is used in many places insidek3-udma.c
This fixes the error: ‘SZ_64K’ undeclared which appears during build timeSigned-off-by Dhruva Gole <[email protected]>Reviewed-by Tom Rini <[email protected]>
Applied to u-boot/master, thanks!
Signature · 1 line
Tom