[PATCH 5/9] kirkwood: make __arch_ioremap() with 0 size return NULL

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

diff --git a/arch/arm/mach-kirkwood/include/mach/io.h b/arch/arm/mach-kirkwood/include/mach/io.h
index 1aaddc3..76345eb 100644
--- a/arch/arm/mach-kirkwood/include/mach/io.h
+++ b/arch/arm/mach-kirkwood/include/mach/io.h
@@ -24,6 +24,10 @@ __arch_ioremap(unsigned long paddr, size_t size, unsigned int mtype)
 {
 	void __iomem *retval;
 	unsigned long offs = paddr - KIRKWOOD_REGS_PHYS_BASE;
+
+	if (!size)
+		return NULL;
+
 	if (mtype == MT_DEVICE && size && offs < KIRKWOOD_REGS_SIZE &&
 	    size <= KIRKWOOD_REGS_SIZE && offs + size <= KIRKWOOD_REGS_SIZE) {
 		retval = (void __iomem *)KIRKWOOD_REGS_VIRT_BASE + offs;
-- 
1.7.4.1




More information about the linux-arm-kernel mailing list