Skip to contentSkip to conversation

arch/x86/kernel/tlb_uv.c: replace kmalloc/memset 0

PATCH New Serafeim Zanikolas 1 participant 1 message Oct 24, 2010 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arch/x86/kernel/tlb_uv.c: replace kmalloc/memset 0

Replace kmalloc followed by memset 0 with kzalloc, and drop the unnecessary cast.

---
 arch/x86/kernel/tlb_uv.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
arch/x86/kernel/tlb_uv.c +1 -3
index 20ea20a..f5b0258 100644
@@ -1520,9 +1520,7 @@ static void __init uv_init_per_cpu(int nuvhubs)
 
 	timeout_us = calculate_destination_timeout();
 
-	uvhub_descs = (struct uvhub_desc *)
-		kmalloc(nuvhubs * sizeof(struct uvhub_desc), GFP_KERNEL);
-	memset(uvhub_descs, 0, nuvhubs * sizeof(struct uvhub_desc));
+	uvhub_descs = kzalloc(nuvhubs * sizeof(struct uvhub_desc), GFP_KERNEL);
 	uvhub_mask = kzalloc((nuvhubs+7)/8, GFP_KERNEL);
 	for_each_present_cpu(cpu) {
 		bcp = &per_cpu(bau_control, cpu);
Signature · 1 line
1.7.1