Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 076ef440 authored by Nicholas Mc Guire's avatar Nicholas Mc Guire Committed by David S. Miller
Browse files

ibmveth: consolidate kmalloc of array, memset 0 to kcalloc



This is an API consolidation only. The use of kmalloc + memset to 0
is equivalent to kcalloc in this case as it is allocating an array
of elements.

Signed-off-by: default avatarNicholas Mc Guire <hofrat@osadl.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 958d104e
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -169,7 +169,7 @@ static int ibmveth_alloc_buffer_pool(struct ibmveth_buff_pool *pool)
	if (!pool->free_map)
		return -1;

	pool->dma_addr = kmalloc(sizeof(dma_addr_t) * pool->size, GFP_KERNEL);
	pool->dma_addr = kcalloc(pool->size, sizeof(dma_addr_t), GFP_KERNEL);
	if (!pool->dma_addr) {
		kfree(pool->free_map);
		pool->free_map = NULL;
@@ -187,8 +187,6 @@ static int ibmveth_alloc_buffer_pool(struct ibmveth_buff_pool *pool)
		return -1;
	}

	memset(pool->dma_addr, 0, sizeof(dma_addr_t) * pool->size);

	for (i = 0; i < pool->size; ++i)
		pool->free_map[i] = i;