[U-Boot] [PATCH] sandbox: Use the address in readl/writel() functions
Simon Glass
sjg at chromium.org
Sat Oct 1 22:42:33 CEST 2016
At present these functions do not touch addr, which can raising warnings
about unused variables.
This fixes the following warnings:
sandbox_spl defconfig
drivers/core/regmap.c: In function ‘regmap_read’:
drivers/core/regmap.c:125:12: warning: unused variable ‘ptr’ [-Wunused-variable]
uint32_t *ptr = map_physmem(map->base + offset, 4, MAP_NOCACHE);
^
drivers/core/regmap.c: In function ‘regmap_write’:
drivers/core/regmap.c:134:12: warning: unused variable ‘ptr’ [-Wunused-variable]
uint32_t *ptr = map_physmem(map->base + offset, 4, MAP_NOCACHE);
Signed-off-by: Simon Glass <sjg at chromium.org>
Fixes: 3bfb8cb4 (dm: regmap: Implement simple regmap_read & regmap_write)
---
arch/sandbox/include/asm/io.h | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/arch/sandbox/include/asm/io.h b/arch/sandbox/include/asm/io.h
index 6919632..a685635 100644
--- a/arch/sandbox/include/asm/io.h
+++ b/arch/sandbox/include/asm/io.h
@@ -40,12 +40,12 @@ static inline void unmap_sysmem(const void *vaddr)
phys_addr_t map_to_sysmem(const void *ptr);
/* Define nops for sandbox I/O access */
-#define readb(addr) 0
-#define readw(addr) 0
-#define readl(addr) 0
-#define writeb(v, addr)
-#define writew(v, addr)
-#define writel(v, addr)
+#define readb(addr) ((void)addr, 0)
+#define readw(addr) ((void)addr, 0)
+#define readl(addr) ((void)addr, 0)
+#define writeb(v, addr) ((void)addr)
+#define writew(v, addr) ((void)addr)
+#define writel(v, addr) ((void)addr)
/* I/O access functions */
int inl(unsigned int addr);
--
2.8.0.rc3.226.g39d4020
More information about the U-Boot
mailing list