[PATCH 1/6] dma: make DMA_ADDRESS_BROKEN type-safe

Ahmad Fatoum a.fatoum at pengutronix.de
Mon Oct 14 05:58:38 PDT 2024


Defining it as void pointer makes it possible to plug this address
everywhere a non-const pointer is accepted.

To make erroneous use less likely, let's give it a proper type.

No functional change expected and if something breaks, it was most
likely already buggy.

Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
 include/dma.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/dma.h b/include/dma.h
index c2b1bee358ae..101116f58466 100644
--- a/include/dma.h
+++ b/include/dma.h
@@ -15,7 +15,7 @@
 #include <asm/io.h>
 #include <device.h>
 
-#define DMA_ADDRESS_BROKEN	NULL
+#define DMA_ADDRESS_BROKEN	((dma_addr_t *)NULL)
 
 #ifndef DMA_ALIGNMENT
 #define DMA_ALIGNMENT	32
-- 
2.39.5




More information about the barebox mailing list