Browse Source

arch/sparc: Use kzalloc_node

Replaced kmalloc_node + memset with kzalloc_node

Signed-off-by: Sabyasachi Gupta <sabyasachi.linux@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Sabyasachi Gupta 6 năm trước cách đây
mục cha
commit
86322ba957
1 tập tin đã thay đổi với 1 bổ sung2 xóa
  1. 1 2
      arch/sparc/kernel/iommu.c

+ 1 - 2
arch/sparc/kernel/iommu.c

@@ -108,10 +108,9 @@ int iommu_table_init(struct iommu *iommu, int tsbsize,
 	/* Allocate and initialize the free area map.  */
 	/* Allocate and initialize the free area map.  */
 	sz = num_tsb_entries / 8;
 	sz = num_tsb_entries / 8;
 	sz = (sz + 7UL) & ~7UL;
 	sz = (sz + 7UL) & ~7UL;
-	iommu->tbl.map = kmalloc_node(sz, GFP_KERNEL, numa_node);
+	iommu->tbl.map = kzalloc_node(sz, GFP_KERNEL, numa_node);
 	if (!iommu->tbl.map)
 	if (!iommu->tbl.map)
 		return -ENOMEM;
 		return -ENOMEM;
-	memset(iommu->tbl.map, 0, sz);
 
 
 	iommu_tbl_pool_init(&iommu->tbl, num_tsb_entries, IO_PAGE_SHIFT,
 	iommu_tbl_pool_init(&iommu->tbl, num_tsb_entries, IO_PAGE_SHIFT,
 			    (tlb_type != hypervisor ? iommu_flushall : NULL),
 			    (tlb_type != hypervisor ? iommu_flushall : NULL),