Skip to contentSkip to conversation

KVM: PPC: Book3S HV: Use kzalloc_node

patch-next Christopher Diaz Riveros 1 participant 1 message Jan 28, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Fixes coccinelle warning:

/arch/powerpc/kvm/book3s_hv.c:5345:3-15: WARNING: kzalloc_node should be used for sibling_subcore_state, instead of kmalloc_node/memset

---
 arch/powerpc/kvm/book3s_hv.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
arch/powerpc/kvm/book3s_hv.c +1 -3
index 5a066fc299e1..fc59bfa892c9 100644
@@ -5342,14 +5342,11 @@ static int kvm_init_subcore_bitmap(void)
 			continue;
 
 		sibling_subcore_state -			kmalloc_node(sizeof(struct sibling_subcore_state),
+			kzalloc_node(sizeof(struct sibling_subcore_state),
 							GFP_KERNEL, node);
 		if (!sibling_subcore_state)
 			return -ENOMEM;
 
-		memset(sibling_subcore_state, 0,
-				sizeof(struct sibling_subcore_state));
-
 		for (j = 0; j < threads_per_core; j++) {
 			int cpu = first_cpu + j;
 
Signature · 1 line
2.20.1