[PATCH 6/9] orion: make __arch_ioremap() with 0 size return NULL

Jamie Iles jamie at jamieiles.com
Mon Aug 1 08:31:07 EDT 2011


Without __arch_ioremap(), __get_vm_area_node() with a zero size will
return a NULL pointer.  Make the arch specific ioremap() do the same
thing.

Cc: Lennert Buytenhek <kernel at wantstofly.org>
Signed-off-by: Jamie Iles <jamie at jamieiles.com>
---
 arch/arm/mach-orion5x/include/mach/io.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-orion5x/include/mach/io.h b/arch/arm/mach-orion5x/include/mach/io.h
index c519610..8763328 100644
--- a/arch/arm/mach-orion5x/include/mach/io.h
+++ b/arch/arm/mach-orion5x/include/mach/io.h
@@ -20,6 +20,10 @@ __arch_ioremap(unsigned long paddr, size_t size, unsigned int mtype)
 {
 	void __iomem *retval;
 	unsigned long offs = paddr - ORION5X_REGS_PHYS_BASE;
+
+	if (!size)
+		return NULL;
+
 	if (mtype == MT_DEVICE && size && offs < ORION5X_REGS_SIZE &&
 	    size <= ORION5X_REGS_SIZE && offs + size <= ORION5X_REGS_SIZE) {
 		retval = (void __iomem *)ORION5X_REGS_VIRT_BASE + offs;
-- 
1.7.4.1




More information about the linux-arm-kernel mailing list