ramdump: fix a warning of cast [1/1]
authorJianxiong Pan <jianxiong.pan@amlogic.com>
Fri, 23 Nov 2018 03:28:38 +0000 (11:28 +0800)
committerJianxiong Pan <jianxiong.pan@amlogic.com>
Fri, 23 Nov 2018 04:31:16 +0000 (12:31 +0800)
PD#165764

Problem:
have a warning of the "ram" variable cast.

Solution:
add a "void *" to the ram variable.

Verify:
test locally.

Change-Id: I037a89a28e98ae8c8ab965e908877bf4a72d3ead
Signed-off-by: Jianxiong Pan <jianxiong.pan@amlogic.com>
drivers/amlogic/memory_ext/ram_dump.c

index c02cdbb..3634ad4 100644 (file)
@@ -282,7 +282,6 @@ void ramdump_sync_data(void)
 static int __init ramdump_probe(struct platform_device *pdev)
 {
        void __iomem *p = NULL;
-       int mapped = 0;
 
        ram = kzalloc(sizeof(struct ramdump), GFP_KERNEL);
        if (!ram)
@@ -299,7 +298,6 @@ static int __init ramdump_probe(struct platform_device *pdev)
                p = ioremap_cache(ramdump_base, ramdump_size);
                ram->mem_base = (unsigned long)p;
                ram->mem_size = ramdump_size;
-               mapped = 1;
        #else
                ram->mem_base = ramdump_base;
                ram->mem_size = ramdump_size;
@@ -327,8 +325,9 @@ static int __init ramdump_probe(struct platform_device *pdev)
 err1:
        kobject_put(ram->kobj);
 err:
-       if (mapped)
-               iounmap((void *)ram->mem_base);
+#ifdef CONFIG_64BIT
+       iounmap((void *)ram->mem_base);
+#endif
        kfree(ram);
 
        return -EINVAL;
@@ -338,7 +337,7 @@ static int ramdump_remove(struct platform_device *pdev)
 {
        sysfs_remove_bin_file(ram->kobj, &ramdump_attr);
 #ifdef CONFIG_64BIT
-       iounmap(ram->mem_base);
+       iounmap((void *)ram->mem_base);
 #endif
        kobject_put(ram->kobj);
        kfree(ram);