From 0fdc25092712fcb8a8f4f2f91451c35a7f4216b6 Mon Sep 17 00:00:00 2001 From: Jianxiong Pan Date: Fri, 23 Nov 2018 11:28:38 +0800 Subject: [PATCH] ramdump: fix a warning of cast [1/1] 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 --- drivers/amlogic/memory_ext/ram_dump.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/amlogic/memory_ext/ram_dump.c b/drivers/amlogic/memory_ext/ram_dump.c index c02cdbb..3634ad4 100644 --- a/drivers/amlogic/memory_ext/ram_dump.c +++ b/drivers/amlogic/memory_ext/ram_dump.c @@ -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); -- 2.7.4