diff mbox series

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

Message ID 20220920052602.143887-1-d-gole@ti.com
State Accepted
Delegated to: Tom Rini
Headers show
Series dma: ti: k3-udma: Fix 'SZ_64K’ undeclared error | expand

Commit Message

Dhruva Gole Sept. 20, 2022, 5:26 a.m. UTC
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@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(+)

Comments

Tom Rini Sept. 20, 2022, 6:16 p.m. UTC | #1
On Tue, Sep 20, 2022 at 10:56:02AM +0530, Dhruva Gole wrote:

> 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@ti.com>

Reviewed-by: Tom Rini <trini@konsulko.com>
Tom Rini Oct. 7, 2022, 3:47 p.m. UTC | #2
On Tue, Sep 20, 2022 at 10:56:02AM +0530, Dhruva Gole wrote:

> 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@ti.com>
> Reviewed-by: Tom Rini <trini@konsulko.com>

Applied to u-boot/master, thanks!
diff mbox series

Patch

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>