diff mbox series

[U-Boot,073/126] trace: Remove the const from write functions

Message ID 20190925145750.200592-74-sjg@chromium.org
State Accepted
Commit 9859dc76e784fb35e99a7c521a3bb2bfe2e6bc38
Delegated to: Bin Meng
Headers show
Series x86: Add initial support for apollolake | expand

Commit Message

Simon Glass Sept. 25, 2019, 2:56 p.m. UTC
The write functions do actually change the contents of memory so it is not
correct to use 'const'. Remove it.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 common/iotrace.c  |  6 +++---
 include/iotrace.h | 13 ++++++-------
 2 files changed, 9 insertions(+), 10 deletions(-)

Comments

Bin Meng Oct. 10, 2019, 3:20 a.m. UTC | #1
On Wed, Sep 25, 2019 at 10:58 PM Simon Glass <sjg@chromium.org> wrote:
>
> The write functions do actually change the contents of memory so it is not
> correct to use 'const'. Remove it.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>
>  common/iotrace.c  |  6 +++---
>  include/iotrace.h | 13 ++++++-------
>  2 files changed, 9 insertions(+), 10 deletions(-)
>

Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Bin Meng Oct. 11, 2019, 8:27 a.m. UTC | #2
On Thu, Oct 10, 2019 at 11:20 AM Bin Meng <bmeng.cn@gmail.com> wrote:
>
> On Wed, Sep 25, 2019 at 10:58 PM Simon Glass <sjg@chromium.org> wrote:
> >
> > The write functions do actually change the contents of memory so it is not
> > correct to use 'const'. Remove it.
> >
> > Signed-off-by: Simon Glass <sjg@chromium.org>
> > ---
> >
> >  common/iotrace.c  |  6 +++---
> >  include/iotrace.h | 13 ++++++-------
> >  2 files changed, 9 insertions(+), 10 deletions(-)
> >
>
> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

applied to u-boot-x86, thanks!
diff mbox series

Patch

diff --git a/common/iotrace.c b/common/iotrace.c
index 49bee3c92a0..5b92fabc76e 100644
--- a/common/iotrace.c
+++ b/common/iotrace.c
@@ -86,7 +86,7 @@  u32 iotrace_readl(const void *ptr)
 	return v;
 }
 
-void iotrace_writel(ulong value, const void *ptr)
+void iotrace_writel(ulong value, void *ptr)
 {
 	add_record(IOT_32 | IOT_WRITE, ptr, value);
 	writel(value, ptr);
@@ -102,7 +102,7 @@  u16 iotrace_readw(const void *ptr)
 	return v;
 }
 
-void iotrace_writew(ulong value, const void *ptr)
+void iotrace_writew(ulong value, void *ptr)
 {
 	add_record(IOT_16 | IOT_WRITE, ptr, value);
 	writew(value, ptr);
@@ -118,7 +118,7 @@  u8 iotrace_readb(const void *ptr)
 	return v;
 }
 
-void iotrace_writeb(ulong value, const void *ptr)
+void iotrace_writeb(ulong value, void *ptr)
 {
 	add_record(IOT_8 | IOT_WRITE, ptr, value);
 	writeb(value, ptr);
diff --git a/include/iotrace.h b/include/iotrace.h
index be1d2753e19..380da1fbc2c 100644
--- a/include/iotrace.h
+++ b/include/iotrace.h
@@ -49,30 +49,29 @@  struct iotrace_record {
 #define readl(addr)	iotrace_readl((const void *)(addr))
 
 #undef writel
-#define writel(val, addr)	iotrace_writel(val, (const void *)(addr))
+#define writel(val, addr)	iotrace_writel(val, (void *)(addr))
 
 #undef readw
 #define readw(addr)	iotrace_readw((const void *)(addr))
 
 #undef writew
-#define writew(val, addr)	iotrace_writew(val, (const void *)(addr))
+#define writew(val, addr)	iotrace_writew(val, (void *)(addr))
 
 #undef readb
 #define readb(addr)	iotrace_readb((const void *)(uintptr_t)addr)
 
 #undef writeb
-#define writeb(val, addr) \
-	iotrace_writeb(val, (const void *)(uintptr_t)addr)
+#define writeb(val, addr)	iotrace_writeb(val, (void *)(uintptr_t)addr)
 
 #endif
 
 /* Tracing functions which mirror their io.h counterparts */
 u32 iotrace_readl(const void *ptr);
-void iotrace_writel(ulong value, const void *ptr);
+void iotrace_writel(ulong value, void *ptr);
 u16 iotrace_readw(const void *ptr);
-void iotrace_writew(ulong value, const void *ptr);
+void iotrace_writew(ulong value, void *ptr);
 u8 iotrace_readb(const void *ptr);
-void iotrace_writeb(ulong value, const void *ptr);
+void iotrace_writeb(ulong value, void *ptr);
 
 /**
  * iotrace_reset_checksum() - Reset the iotrace checksum