Patchwork [U-Boot,v3,01/16] sandbox: Make map_to_sysmem() use a constant pointer

login
register
mail settings
Submitter Simon Glass
Date June 19, 2013, 3:52 a.m.
Message ID <1371613960-28678-2-git-send-email-sjg@chromium.org>
Download mbox | patch
Permalink /patch/252470/
State Superseded
Delegated to: Tom Rini
Headers show

Comments

Simon Glass - June 19, 2013, 3:52 a.m.
Very often a constant pointer is passed to this function, so we should
declare this, since map_to_sysmem() does not change the pointer.

Signed-off-by: Simon Glass <sjg@chromium.org>
---
Changes in v3: None
Changes in v2: None

 arch/sandbox/include/asm/io.h | 2 +-
 include/common.h              | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Patch

diff --git a/arch/sandbox/include/asm/io.h b/arch/sandbox/include/asm/io.h
index 0c022f1..321bc0d 100644
--- a/arch/sandbox/include/asm/io.h
+++ b/arch/sandbox/include/asm/io.h
@@ -54,6 +54,6 @@  static inline void unmap_sysmem(const void *vaddr)
 }
 
 /* Map from a pointer to our RAM buffer */
-phys_addr_t map_to_sysmem(void *ptr);
+phys_addr_t map_to_sysmem(const void *ptr);
 
 #endif
diff --git a/include/common.h b/include/common.h
index 126891d..ad3a64b 100644
--- a/include/common.h
+++ b/include/common.h
@@ -926,7 +926,7 @@  static inline void unmap_sysmem(const void *vaddr)
 {
 }
 
-static inline phys_addr_t map_to_sysmem(void *ptr)
+static inline phys_addr_t map_to_sysmem(const void *ptr)
 {
 	return (phys_addr_t)(uintptr_t)ptr;
 }