From: Arnd Bergmann <arnd@arndb.de>
To: Imre Kaloz <kaloz@openwrt.org>,
Krzysztof Halasa <khalasa@piap.pl>, Arnd Bergmann <arnd@arndb.de>
Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: [PATCH 09/12] ARM: ixp4xx: use normal prototype for {read,write}s{b,w,l}
Date: Thu, 20 Jul 2017 17:51:47 +0200 [thread overview]
Message-ID: <20170720155209.3250880-6-arnd@arndb.de> (raw)
In-Reply-To: <20170720154616.3250481-1-arnd@arndb.de>
ixp4xx defines the arguments to its __indirect_writesb() and other
functions as pointers to fixed-size data. This is not necessarily
wrong, and it works most of the time, but it causes warnings in
at least one driver:
drivers/net/ethernet/smsc/smc91x.c: In function 'smc_rcv':
drivers/net/ethernet/smsc/smc91x.c:495:21: error: passing argument 2 of '__indirect_readsw' from incompatible pointer type [-Werror=incompatible-pointer-types]
SMC_PULL_DATA(lp, data, packet_len - 4);
All other definitions of the same functions pass void pointers,
so doing the same here avoids the warnings.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Krzysztof Halasa <khalasa@piap.pl>
---
Originally sent on Feb 2016, but it got lost
---
arch/arm/mach-ixp4xx/include/mach/io.h | 23 +++++++++++++++++------
1 file changed, 17 insertions(+), 6 deletions(-)
diff --git a/arch/arm/mach-ixp4xx/include/mach/io.h b/arch/arm/mach-ixp4xx/include/mach/io.h
index 2f84c26a6758..844e8ac593e2 100644
--- a/arch/arm/mach-ixp4xx/include/mach/io.h
+++ b/arch/arm/mach-ixp4xx/include/mach/io.h
@@ -95,8 +95,10 @@ static inline void __indirect_writeb(u8 value, volatile void __iomem *p)
}
static inline void __indirect_writesb(volatile void __iomem *bus_addr,
- const u8 *vaddr, int count)
+ const void *p, int count)
{
+ const u8 *vaddr = p;
+
while (count--)
writeb(*vaddr++, bus_addr);
}
@@ -118,8 +120,10 @@ static inline void __indirect_writew(u16 value, volatile void __iomem *p)
}
static inline void __indirect_writesw(volatile void __iomem *bus_addr,
- const u16 *vaddr, int count)
+ const void *p, int count)
{
+ const u16 *vaddr = p;
+
while (count--)
writew(*vaddr++, bus_addr);
}
@@ -137,8 +141,9 @@ static inline void __indirect_writel(u32 value, volatile void __iomem *p)
}
static inline void __indirect_writesl(volatile void __iomem *bus_addr,
- const u32 *vaddr, int count)
+ const void *p, int count)
{
+ const u32 *vaddr = p;
while (count--)
writel(*vaddr++, bus_addr);
}
@@ -160,8 +165,10 @@ static inline u8 __indirect_readb(const volatile void __iomem *p)
}
static inline void __indirect_readsb(const volatile void __iomem *bus_addr,
- u8 *vaddr, u32 count)
+ void *p, u32 count)
{
+ u8 *vaddr = p;
+
while (count--)
*vaddr++ = readb(bus_addr);
}
@@ -183,8 +190,10 @@ static inline u16 __indirect_readw(const volatile void __iomem *p)
}
static inline void __indirect_readsw(const volatile void __iomem *bus_addr,
- u16 *vaddr, u32 count)
+ void *p, u32 count)
{
+ u16 *vaddr = p;
+
while (count--)
*vaddr++ = readw(bus_addr);
}
@@ -204,8 +213,10 @@ static inline u32 __indirect_readl(const volatile void __iomem *p)
}
static inline void __indirect_readsl(const volatile void __iomem *bus_addr,
- u32 *vaddr, u32 count)
+ void *p, u32 count)
{
+ u32 *vaddr = p;
+
while (count--)
*vaddr++ = readl(bus_addr);
}
--
2.9.0
next prev parent reply other threads:[~2017-07-20 15:53 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20170720154616.3250481-1-arnd@arndb.de>
2017-07-20 15:45 ` [PATCH 01/12] ARM: ixp4xx: fix ioport_unmap definition Arnd Bergmann
2017-07-21 12:21 ` Krzysztof Hałasa
2017-07-20 15:49 ` [PATCH 02/12] ARM: ep93xx: use ARM_PATCH_PHYS_VIRT Arnd Bergmann
2017-07-20 16:07 ` Alexander Sverdlin
2017-08-02 12:29 ` Linus Walleij
2017-07-20 15:50 ` [PATCH 03/12] ARM: normalize clk API for older platforms Arnd Bergmann
2017-07-21 8:05 ` Sekhar Nori
2017-07-21 8:17 ` Arnd Bergmann
2017-07-21 9:44 ` Sekhar Nori
2017-07-20 15:51 ` [PATCH 04/12] ARM: sa1100/pxa: fix MTD_XIP build Arnd Bergmann
2017-07-23 15:53 ` Robert Jarzmik
2017-07-25 15:14 ` Arnd Bergmann
2017-07-20 15:51 ` [PATCH 05/12] ARM: mmp: mark usb_dma_mask as __maybe_unused Arnd Bergmann
2017-07-20 15:51 ` [PATCH 06/12] ARM: omap2: mark unused functions " Arnd Bergmann
2017-07-27 10:08 ` Sebastian Reichel
2017-07-20 15:51 ` [PATCH 07/12] ARM: omap1: avoid unused variable warning Arnd Bergmann
2017-07-20 15:51 ` [PATCH 08/12] ARM: sirf: mark sirfsoc_init_late as __maybe_unused Arnd Bergmann
2017-07-20 15:51 ` Arnd Bergmann [this message]
2017-07-20 15:53 ` [PATCH 10/12] [v2] ARM: s3c24xx: make H1940BT depend on RFKILL Arnd Bergmann
2017-07-20 19:30 ` Krzysztof Kozlowski
2017-07-20 15:53 ` [PATCH 11/12] ARM: omap1/ams-delta: warn about failed regulator enable Arnd Bergmann
2017-07-20 15:53 ` [PATCH 12/12] ARM: rpc: rename RAM_SIZE macro Arnd Bergmann
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=20170720155209.3250880-6-arnd@arndb.de \
--to=arnd@arndb.de \
--cc=kaloz@openwrt.org \
--cc=khalasa@piap.pl \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.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
Powered by JetHome