[PATCH 3/9] ixp23xx: make __arch_ioremap() with 0 size return NULL

Jamie Iles jamie at jamieiles.com
Mon Aug 1 08:31:04 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-ixp23xx/include/mach/io.h |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-ixp23xx/include/mach/io.h b/arch/arm/mach-ixp23xx/include/mach/io.h
index a1749d0..b3e9d08 100644
--- a/arch/arm/mach-ixp23xx/include/mach/io.h
+++ b/arch/arm/mach-ixp23xx/include/mach/io.h
@@ -23,6 +23,9 @@
 static inline void __iomem *
 ixp23xx_ioremap(unsigned long addr, unsigned long size, unsigned int mtype)
 {
+	if (!size)
+		return NULL;
+
 	if (addr >= IXP23XX_PCI_MEM_START &&
 		addr <= IXP23XX_PCI_MEM_START + IXP23XX_PCI_MEM_SIZE) {
 		if (addr + size > IXP23XX_PCI_MEM_START + IXP23XX_PCI_MEM_SIZE)
-- 
1.7.4.1




More information about the linux-arm-kernel mailing list