All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/5] sandbox: Drop 'const' from sandbox_write()
Date: Fri, 11 Oct 2019 16:16:47 -0600	[thread overview]
Message-ID: <20191011221650.19482-3-sjg@chromium.org> (raw)
In-Reply-To: <20191011221650.19482-1-sjg@chromium.org>

This function writes to its address so the address should not be declared
as const. Fix it.

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

 arch/sandbox/cpu/cpu.c        |  3 +--
 arch/sandbox/include/asm/io.h | 11 +++++------
 2 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/arch/sandbox/cpu/cpu.c b/arch/sandbox/cpu/cpu.c
index 2046cb53c4a..f3af88d79e9 100644
--- a/arch/sandbox/cpu/cpu.c
+++ b/arch/sandbox/cpu/cpu.c
@@ -246,8 +246,7 @@ unsigned int sandbox_read(const void *addr, enum sandboxio_size_t size)
 	return 0;
 }
 
-void sandbox_write(const void *addr, unsigned int val,
-		   enum sandboxio_size_t size)
+void sandbox_write(void *addr, unsigned int val, enum sandboxio_size_t size)
 {
 	struct sandbox_state *state = state_get_current();
 
diff --git a/arch/sandbox/include/asm/io.h b/arch/sandbox/include/asm/io.h
index 4a35c419723..ad6c29a4e26 100644
--- a/arch/sandbox/include/asm/io.h
+++ b/arch/sandbox/include/asm/io.h
@@ -46,8 +46,7 @@ static inline void unmap_sysmem(const void *vaddr)
 phys_addr_t map_to_sysmem(const void *ptr);
 
 unsigned int sandbox_read(const void *addr, enum sandboxio_size_t size);
-void sandbox_write(const void *addr, unsigned int val,
-		   enum sandboxio_size_t size);
+void sandbox_write(void *addr, unsigned int val, enum sandboxio_size_t size);
 
 #define readb(addr) sandbox_read((const void *)addr, SB_SIZE_8)
 #define readw(addr) sandbox_read((const void *)addr, SB_SIZE_16)
@@ -55,11 +54,11 @@ void sandbox_write(const void *addr, unsigned int val,
 #ifdef CONFIG_SANDBOX64
 #define readq(addr) sandbox_read((const void *)addr, SB_SIZE_64)
 #endif
-#define writeb(v, addr) sandbox_write((const void *)addr, v, SB_SIZE_8)
-#define writew(v, addr) sandbox_write((const void *)addr, v, SB_SIZE_16)
-#define writel(v, addr) sandbox_write((const void *)addr, v, SB_SIZE_32)
+#define writeb(v, addr) sandbox_write((void *)addr, v, SB_SIZE_8)
+#define writew(v, addr) sandbox_write((void *)addr, v, SB_SIZE_16)
+#define writel(v, addr) sandbox_write((void *)addr, v, SB_SIZE_32)
 #ifdef CONFIG_SANDBOX64
-#define writeq(v, addr) sandbox_write((const void *)addr, v, SB_SIZE_64)
+#define writeq(v, addr) sandbox_write((void *)addr, v, SB_SIZE_64)
 #endif
 
 /*
-- 
2.23.0.700.g56cf767bdb-goog

  parent reply	other threads:[~2019-10-11 22:16 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-11 22:16 [U-Boot] [PATCH 0/5] dm: regmap: Various fixes for regmap Simon Glass
2019-10-11 22:16 ` [U-Boot] [PATCH 1/5] sandbox: test: Show hex values on failure Simon Glass
2019-10-12  2:13   ` Bin Meng
2019-10-29 23:21   ` sjg at google.com
2019-10-11 22:16 ` Simon Glass [this message]
2019-10-12  2:12   ` [U-Boot] [PATCH 2/5] sandbox: Drop 'const' from sandbox_write() Bin Meng
2019-10-29 23:21   ` sjg at google.com
2019-10-11 22:16 ` [U-Boot] [PATCH 3/5] sandbox: test: Add a prototype for sandbox_set_enable_memio() Simon Glass
2019-10-12  2:13   ` Bin Meng
2019-10-29 23:21   ` sjg at google.com
2019-10-11 22:16 ` [U-Boot] [PATCH 4/5] dm: regmap: Fix mask in regmap_update_bits() Simon Glass
2019-10-12  2:17   ` Bin Meng
2019-10-25  9:40   ` Jean-Jacques Hiblot
2019-10-29 23:21   ` sjg at google.com
2019-10-11 22:16 ` [U-Boot] [PATCH 5/5] test: regmap: check the values read from the regmap Simon Glass
2019-10-12  2:41   ` Bin Meng
2019-10-29 23:21   ` sjg at google.com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191011221650.19482-3-sjg@chromium.org \
    --to=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.