linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: sboyd@codeaurora.org (Stephen Boyd)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 1/4] frv: io: Accept const void pointers for read{b,w,l}()
Date: Fri, 23 Oct 2015 13:01:49 -0700	[thread overview]
Message-ID: <1445630512-10888-2-git-send-email-sboyd@codeaurora.org> (raw)
In-Reply-To: <1445630512-10888-1-git-send-email-sboyd@codeaurora.org>

The frv port uses compiler builtins, __builtin_read*(), for the
I/O read routines. Unfortunately, these don't accept const void
pointers although the generic ASM implementations do, so generic
code passing const pointers to these APIs cause compilers to emit
warnings. Add wrapper functions that cast away the const to avoid
the warnings.

Cc: David Howells <dhowells@redhat.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
---
 arch/frv/include/asm/io.h | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/arch/frv/include/asm/io.h b/arch/frv/include/asm/io.h
index 70dfbea8c8d7..8062fc73fad0 100644
--- a/arch/frv/include/asm/io.h
+++ b/arch/frv/include/asm/io.h
@@ -43,9 +43,20 @@ static inline unsigned long _swapl(unsigned long v)
 //#define __iormb() asm volatile("membar")
 //#define __iowmb() asm volatile("membar")
 
-#define __raw_readb __builtin_read8
-#define __raw_readw __builtin_read16
-#define __raw_readl __builtin_read32
+static inline u8 __raw_readb(const volatile void __iomem *addr)
+{
+	return __builtin_read8((volatile void __iomem *)addr);
+}
+
+static inline u16 __raw_readw(const volatile void __iomem *addr)
+{
+	return __builtin_read16((volatile void __iomem *)addr);
+}
+
+static inline u32 __raw_readl(const volatile void __iomem *addr)
+{
+	return __builtin_read32((volatile void __iomem *)addr);
+}
 
 #define __raw_writeb(datum, addr) __builtin_write8(addr, datum)
 #define __raw_writew(datum, addr) __builtin_write16(addr, datum)
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

  reply	other threads:[~2015-10-23 20:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-23 20:01 [PATCH v3 0/4] Add __ioread32_copy() and use it Stephen Boyd
2015-10-23 20:01 ` Stephen Boyd [this message]
2015-10-23 20:01 ` [PATCH v3 2/4] lib: iomap_copy: Add __ioread32_copy() Stephen Boyd
2015-10-23 20:01 ` [PATCH v3 3/4] soc: qcom: smd: Use __ioread32_copy() instead of open-coding it Stephen Boyd
2015-10-23 20:22   ` Bjorn Andersson
2015-10-26  2:00   ` Andy Gross
2015-10-23 20:01 ` [PATCH v3 4/4] FIRMWARE: bcm47xx_nvram: Use __ioread32_copy() instead of open-coding Stephen Boyd

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=1445630512-10888-2-git-send-email-sboyd@codeaurora.org \
    --to=sboyd@codeaurora.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).