kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] KVM: PPC: e500: Casting (void *) value returned by kmalloc is useless
@ 2011-11-08 19:15 Thomas Meyer
  2011-11-11 14:05 ` Alexander Graf
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas Meyer @ 2011-11-08 19:15 UTC (permalink / raw)
  To: Avi Kivity, Alexander Graf, kvm, linux-kernel

From: Thomas Meyer <thomas@m3y3r.de>

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

 The semantic patch that makes this change is available
 in scripts/coccinelle/api/alloc/drop_kmalloc_cast.cocci.

 More information about semantic patching is available at
 http://coccinelle.lip6.fr/

Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
---

diff -u -p a/arch/powerpc/kvm/e500_tlb.c b/arch/powerpc/kvm/e500_tlb.c
--- a/arch/powerpc/kvm/e500_tlb.c 2011-11-07 19:37:27.329638682 +0100
+++ b/arch/powerpc/kvm/e500_tlb.c 2011-11-08 09:18:39.955928218 +0100
@@ -1026,11 +1026,11 @@ int kvmppc_e500_tlb_init(struct kvmppc_v
 	if (vcpu_e500->gtlb_arch[1] == NULL)
 		goto err_out_guest0;
 
-	vcpu_e500->gtlb_priv[0] = (struct tlbe_priv *)
+	vcpu_e500->gtlb_priv[0] =
 		kzalloc(sizeof(struct tlbe_priv) * KVM_E500_TLB0_SIZE, GFP_KERNEL);
 	if (vcpu_e500->gtlb_priv[0] == NULL)
 		goto err_out_guest1;
-	vcpu_e500->gtlb_priv[1] = (struct tlbe_priv *)
+	vcpu_e500->gtlb_priv[1] =
 		kzalloc(sizeof(struct tlbe_priv) * KVM_E500_TLB1_SIZE, GFP_KERNEL);
 
 	if (vcpu_e500->gtlb_priv[1] == NULL)

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-11-11 15:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-08 19:15 [PATCH] KVM: PPC: e500: Casting (void *) value returned by kmalloc is useless Thomas Meyer
2011-11-11 14:05 ` Alexander Graf
2011-11-11 15:24   ` Thomas Meyer
2011-11-11 15:27     ` Alexander Graf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).