[PATCH 8/9] iop: make __arch_ioremap() with 0 size return NULL

Jamie Iles jamie at jamieiles.com
Mon Aug 1 08:31:09 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/plat-iop/io.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch/arm/plat-iop/io.c b/arch/arm/plat-iop/io.c
index e15bc17..9800b15 100644
--- a/arch/arm/plat-iop/io.c
+++ b/arch/arm/plat-iop/io.c
@@ -26,6 +26,9 @@ void * __iomem __iop3xx_ioremap(unsigned long cookie, size_t size,
 {
 	void __iomem * retval;
 
+	if (!size)
+		return NULL;
+
 	switch (cookie) {
 	case IOP3XX_PCI_LOWER_IO_PA ... IOP3XX_PCI_UPPER_IO_PA:
 		retval = (void *) IOP3XX_PCI_IO_PHYS_TO_VIRT(cookie);
-- 
1.7.4.1




More information about the linux-arm-kernel mailing list