powerpc: remove cast for kmalloc/kzalloc return value
authorZhang Yanfei <zhangyanfei@cn.fujitsu.com>
Mon, 11 Mar 2013 18:54:06 +0000 (18:54 +0000)
committerMichael Ellerman <michael@ellerman.id.au>
Thu, 18 Apr 2013 03:03:56 +0000 (13:03 +1000)
remove cast for kmalloc/kzalloc return value.

Signed-off-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
arch/powerpc/kernel/nvram_64.c
arch/powerpc/kvm/book3s_pr.c

index bec1e930ed736e233f5022e4255a9d50f6462356..48fbc2b97e952114c45162515ed211a9d40be40a 100644 (file)
@@ -511,8 +511,7 @@ int __init nvram_scan_partitions(void)
                               "detected: 0-length partition\n");
                        goto out;
                }
-               tmp_part = (struct nvram_partition *)
-                       kmalloc(sizeof(struct nvram_partition), GFP_KERNEL);
+               tmp_part = kmalloc(sizeof(struct nvram_partition), GFP_KERNEL);
                err = -ENOMEM;
                if (!tmp_part) {
                        printk(KERN_ERR "nvram_scan_partitions: kmalloc failed\n");
index 5e93438afb068c89b27062cec2bb772d4e77ce4c..dbdc15aa8127f2c13e29359236e7b0869ad899fc 100644 (file)
@@ -1039,7 +1039,7 @@ struct kvm_vcpu *kvmppc_core_vcpu_create(struct kvm *kvm, unsigned int id)
        if (!vcpu_book3s)
                goto out;
 
-       vcpu_book3s->shadow_vcpu = (struct kvmppc_book3s_shadow_vcpu *)
+       vcpu_book3s->shadow_vcpu =
                kzalloc(sizeof(*vcpu_book3s->shadow_vcpu), GFP_KERNEL);
        if (!vcpu_book3s->shadow_vcpu)
                goto free_vcpu;