Patchwork [06/17,trivial] mtd: Remove unnecessary casts of void ptr returning alloc function return values

login
register
mail settings
Submitter Jesper Juhl
Date Nov. 8, 2010, 11:09 p.m.
Message ID <alpine.LNX.2.00.1011082327290.23697@swampdragon.chaosbits.net>
Download mbox | patch
Permalink /patch/70477/
State New
Headers show

Comments

Jesper Juhl - Nov. 8, 2010, 11:09 p.m.
Hi,

The [vk][cmz]alloc(_node) family of functions return void pointers which
it's completely unnecessary/pointless to cast to other pointer types since
that happens implicitly.

This patch removes such casts from drivers/mtd/


Signed-off-by: Jesper Juhl <jj@chaosbits.net>
---
 tqm8xxl.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Artem Bityutskiy - Nov. 26, 2010, 3:40 p.m.
On Tue, 2010-11-09 at 00:09 +0100, Jesper Juhl wrote:
> Hi,
> 
> The [vk][cmz]alloc(_node) family of functions return void pointers which
> it's completely unnecessary/pointless to cast to other pointer types since
> that happens implicitly.
> 
> This patch removes such casts from drivers/mtd/

Pushed to l2-mtd-2.6.git, thanks.

Patch

diff --git a/drivers/mtd/maps/tqm8xxl.c b/drivers/mtd/maps/tqm8xxl.c
index 6014698..c08e140 100644
--- a/drivers/mtd/maps/tqm8xxl.c
+++ b/drivers/mtd/maps/tqm8xxl.c
@@ -139,7 +139,7 @@  static int __init init_tqm_mtd(void)
 			goto error_mem;
 		}
 
-		map_banks[idx]->name = (char *)kmalloc(16, GFP_KERNEL);
+		map_banks[idx]->name = kmalloc(16, GFP_KERNEL);
 
 		if (!map_banks[idx]->name) {
 			ret = -ENOMEM;