Skip to contentSkip to conversation

batman-adv: Remove cast after kmalloc

PATCH Applied Sven Eckelmann 2 participants 2 messages Jun 8, 2011 – Jun 9, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 batman-adv: Remove cast after kmalloc

Casting (void *) value returned by kmalloc is useless as mentioned in Documentation/CodingStyle, Chap 14.

This regression was introduced in
cea194d90b11aff7fc289149e4c7f305fad3535a

---
 translation-table.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
translation-table.c +1 -2
index d2a9f80..adecf1b 100644
@@ -148,8 +148,7 @@ static void tt_local_event(struct bat_priv *bat_priv, uint8_t op,
 {
 	struct tt_change_node *tt_change_node;
 
-	tt_change_node = (struct tt_change_node *)
-		kmalloc(sizeof(*tt_change_node), GFP_ATOMIC);
+	tt_change_node = kmalloc(sizeof(*tt_change_node), GFP_ATOMIC);
 
 	if (!tt_change_node)
 		return;
Signature · 1 line
1.7.5.3
#1 lore raw
Quoted 5 lines · Sven Eckelmann

Casting (void *) value returned by kmalloc is useless as mentioned in Documentation/CodingStyle, Chap 14.

This regression was introduced in
cea194d90b11aff7fc289149e4c7f305fad3535a

Applied in revision 4591fc4.

Thanks,
Marek