[PATCH 1/2] mtd: fix wrong usage of ioremap_nocache() in uclinux.c map driver

Artem Bityutskiy dedekind1 at gmail.com
Mon May 14 08:05:24 EDT 2012


Hi,

I have few requests

On Thu, 2012-05-10 at 16:55 +1000, gerg at snapgear.com wrote:
> @@ -80,7 +80,6 @@ static int __init uclinux_mtd_init(void)
>  	mtd = do_map_probe("map_ram", mapp);
>  	if (!mtd) {
>  		printk("uclinux[mtd]: failed to find a mapping?\n");

KERN_ERR prefixe is missing. Please, fix other printks in this file
while on it.

> -		iounmap(mapp->virt);
>  		return(-ENXIO);
>  	}
>  
> @@ -103,10 +102,8 @@ static void __exit uclinux_mtd_cleanup(void)
>  		map_destroy(uclinux_ram_mtdinfo);
>  		uclinux_ram_mtdinfo = NULL;
>  	}
> -	if (uclinux_ram_map.virt) {
> -		iounmap((void *) uclinux_ram_map.virt);
> +	if (uclinux_ram_map.virt)
>  		uclinux_ram_map.virt = 0;
> -	}

The "if" statements are redundant - could you please kill them?

Would you please be kind to address these sparse warnings while you work
on this rarely used file:

drivers/mtd/maps/uclinux.c:27:17: warning: symbol 'uclinux_ram_map' was not declared. Should it be static? [sparse]
drivers/mtd/maps/uclinux.c:49:15: warning: incorrect type in assignment (different address spaces) [sparse]
drivers/mtd/maps/uclinux.c:49:15:    expected void *<noident> [sparse]
drivers/mtd/maps/uclinux.c:49:15:    got void [noderef] <asn:2>* [sparse]
drivers/mtd/maps/uclinux.c:71:20: warning: incorrect type in assignment (different address spaces) [sparse]
drivers/mtd/maps/uclinux.c:71:20:    expected void [noderef] <asn:2>*virt [sparse]
drivers/mtd/maps/uclinux.c:71:20:    got void * [sparse]
drivers/mtd/maps/uclinux.c:73:27: warning: Using plain integer as NULL pointer [sparse]
drivers/mtd/maps/uclinux.c:106:40: warning: Using plain integer as NULL pointer [sparse]

Thanks!

-- 
Best Regards,
Artem Bityutskiy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
URL: <http://lists.infradead.org/pipermail/linux-mtd/attachments/20120514/d7c61afc/attachment.sig>


More information about the linux-mtd mailing list