OSDN Git Service

arch/sparc: Use kzalloc_node
authorSabyasachi Gupta <sabyasachi.linux@gmail.com>
Sat, 3 Nov 2018 05:24:52 +0000 (10:54 +0530)
committerDavid S. Miller <davem@davemloft.net>
Mon, 19 Nov 2018 02:58:35 +0000 (18:58 -0800)
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>
arch/sparc/kernel/iommu.c

index 40d008b..05eb016 100644 (file)
@@ -108,10 +108,9 @@ int iommu_table_init(struct iommu *iommu, int tsbsize,
        /* Allocate and initialize the free area map.  */
        sz = num_tsb_entries / 8;
        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)
                return -ENOMEM;
-       memset(iommu->tbl.map, 0, sz);
 
        iommu_tbl_pool_init(&iommu->tbl, num_tsb_entries, IO_PAGE_SHIFT,
                            (tlb_type != hypervisor ? iommu_flushall : NULL),