mtd: impa7: add missing __iomem annotation

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Fri Aug 30 16:59:05 EDT 2013


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=d1d90c992da5b0b96cd6d3b2c0958b236808fb47
Commit:     d1d90c992da5b0b96cd6d3b2c0958b236808fb47
Parent:     582b2ffcaa4bd2f39801d6ffe9d076a5c555952a
Author:     Jingoo Han <jg1.han at samsung.com>
AuthorDate: Wed Aug 7 16:12:14 2013 +0900
Committer:  David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Fri Aug 30 21:51:40 2013 +0100

    mtd: impa7: add missing __iomem annotation
    
    Added missing __iomem annotation and used NULL instead of 0
    in order to fix the following sparse warnings:
    
    drivers/mtd/maps/impa7.c:82:32: warning: Using plain integer as NULL pointer
    drivers/mtd/maps/impa7.c:96:34: warning: cast removes address space of expression
    drivers/mtd/maps/impa7.c:96:34: warning: incorrect type in argument 1 (different address spaces)
    drivers/mtd/maps/impa7.c:96:34:    expected void volatile [noderef] <asn:2>*addr
    drivers/mtd/maps/impa7.c:96:34:    got void *<noident>
    drivers/mtd/maps/impa7.c:108:34: warning: cast removes address space of expression
    drivers/mtd/maps/impa7.c:108:34: warning: incorrect type in argument 1 (different address spaces)
    drivers/mtd/maps/impa7.c:108:34:    expected void volatile [noderef] <asn:2>*addr
    drivers/mtd/maps/impa7.c:108:34:    got void *<noident>
    drivers/mtd/maps/impa7.c:109:45: warning: Using plain integer as NULL pointer
    
    Signed-off-by: Jingoo Han <jg1.han at samsung.com>
    Signed-off-by: Brian Norris <computersforpeace at gmail.com>
    Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
 drivers/mtd/maps/impa7.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/mtd/maps/impa7.c b/drivers/mtd/maps/impa7.c
index 4968674..15bbda0 100644
--- a/drivers/mtd/maps/impa7.c
+++ b/drivers/mtd/maps/impa7.c
@@ -79,7 +79,7 @@ static int __init init_impa7(void)
 		}
 		simple_map_init(&impa7_map[i]);
 
-		impa7_mtd[i] = 0;
+		impa7_mtd[i] = NULL;
 		type = rom_probe_types;
 		for(; !impa7_mtd[i] && *type; type++) {
 			impa7_mtd[i] = do_map_probe(*type, &impa7_map[i]);
@@ -91,9 +91,9 @@ static int __init init_impa7(void)
 			mtd_device_parse_register(impa7_mtd[i], NULL, NULL,
 						  partitions,
 						  ARRAY_SIZE(partitions));
+		} else {
+			iounmap((void __iomem *)impa7_map[i].virt);
 		}
-		else
-			iounmap((void *)impa7_map[i].virt);
 	}
 	return devicesfound == 0 ? -ENXIO : 0;
 }
@@ -105,8 +105,8 @@ static void __exit cleanup_impa7(void)
 		if (impa7_mtd[i]) {
 			mtd_device_unregister(impa7_mtd[i]);
 			map_destroy(impa7_mtd[i]);
-			iounmap((void *)impa7_map[i].virt);
-			impa7_map[i].virt = 0;
+			iounmap((void __iomem *)impa7_map[i].virt);
+			impa7_map[i].virt = NULL;
 		}
 	}
 }



More information about the linux-mtd-cvs mailing list