Re: [U-Boot] [PATCH] sandbox: Use the address in readl/writel() functions

2016-10-10 Thread Simon Glass
On 1 October 2016 at 14:42, Simon Glass  wrote:
> 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 
> Fixes: 3bfb8cb4 (dm: regmap: Implement simple regmap_read & regmap_write)
> ---
>
>  arch/sandbox/include/asm/io.h | 12 ++--
>  1 file changed, 6 insertions(+), 6 deletions(-)

Applied to u-boot-dm
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] sandbox: Use the address in readl/writel() functions

2016-10-01 Thread Simon Glass
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 
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

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot