Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9b97173e authored by Laura Abbott's avatar Laura Abbott Committed by Russell King
Browse files

ARM: 7728/1: mm: Use phys_addr_t properly for ioremap functions



Several of the ioremap functions use unsigned long in places
resulting in truncation if physical addresses greater than
4G are passed in. Change the types of the functions and the
callers accordingly.

Cc: Krzysztof Halasa <khc@pm.waw.pl>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: default avatarLaura Abbott <lauraa@codeaurora.org>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 3b656fed
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -130,16 +130,16 @@ static inline u32 __raw_readl(const volatile void __iomem *addr)
 */
extern void __iomem *__arm_ioremap_pfn_caller(unsigned long, unsigned long,
	size_t, unsigned int, void *);
extern void __iomem *__arm_ioremap_caller(unsigned long, size_t, unsigned int,
extern void __iomem *__arm_ioremap_caller(phys_addr_t, size_t, unsigned int,
	void *);

extern void __iomem *__arm_ioremap_pfn(unsigned long, unsigned long, size_t, unsigned int);
extern void __iomem *__arm_ioremap(unsigned long, size_t, unsigned int);
extern void __iomem *__arm_ioremap_exec(unsigned long, size_t, bool cached);
extern void __iomem *__arm_ioremap(phys_addr_t, size_t, unsigned int);
extern void __iomem *__arm_ioremap_exec(phys_addr_t, size_t, bool cached);
extern void __iounmap(volatile void __iomem *addr);
extern void __arm_iounmap(volatile void __iomem *addr);

extern void __iomem * (*arch_ioremap_caller)(unsigned long, size_t,
extern void __iomem * (*arch_ioremap_caller)(phys_addr_t, size_t,
	unsigned int, void *);
extern void (*arch_iounmap)(volatile void __iomem *);

+1 −1
Original line number Diff line number Diff line
@@ -116,7 +116,7 @@ static void __init ebsa110_map_io(void)
	iotable_init(ebsa110_io_desc, ARRAY_SIZE(ebsa110_io_desc));
}

static void __iomem *ebsa110_ioremap_caller(unsigned long cookie, size_t size,
static void __iomem *ebsa110_ioremap_caller(phys_addr_t cookie, size_t size,
					    unsigned int flags, void *caller)
{
	return (void __iomem *)cookie;
+1 −1
Original line number Diff line number Diff line
@@ -65,7 +65,7 @@ static void imx3_idle(void)
		: "=r" (reg));
}

static void __iomem *imx3_ioremap_caller(unsigned long phys_addr, size_t size,
static void __iomem *imx3_ioremap_caller(phys_addr_t phys_addr, size_t size,
					 unsigned int mtype, void *caller)
{
	if (mtype == MT_DEVICE) {
+1 −1
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@

#include "pci.h"

static void __iomem *__iop13xx_ioremap_caller(unsigned long cookie,
static void __iomem *__iop13xx_ioremap_caller(phys_addr_t cookie,
	size_t size, unsigned int mtype, void *caller)
{
	void __iomem * retval;
+1 −1
Original line number Diff line number Diff line
@@ -559,7 +559,7 @@ void ixp4xx_restart(char mode, const char *cmd)
 * fallback to the default.
 */

static void __iomem *ixp4xx_ioremap_caller(unsigned long addr, size_t size,
static void __iomem *ixp4xx_ioremap_caller(phys_addr_t addr, size_t size,
					   unsigned int mtype, void *caller)
{
	if (!is_pci_memory(addr))
Loading