diff options
author | Nicholas Mc Guire <hofrat@osadl.org> | 2015-12-20 15:06:18 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-12-20 18:59:41 +0100 |
commit | 076ef440708bc28d821cebb2dbca64e3c917ac73 (patch) | |
tree | de3fc103f7d5c7adabbdae0f6db6afe69205a68c /drivers/net/ethernet/ibm | |
parent | netcp: fix regression in receive processing (diff) | |
download | linux-076ef440708bc28d821cebb2dbca64e3c917ac73.tar.xz linux-076ef440708bc28d821cebb2dbca64e3c917ac73.zip |
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: Nicholas Mc Guire <hofrat@osadl.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/ibm')
-rw-r--r-- | drivers/net/ethernet/ibm/ibmveth.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/net/ethernet/ibm/ibmveth.c b/drivers/net/ethernet/ibm/ibmveth.c index 6691b5a45b9d..335417b4756b 100644 --- a/drivers/net/ethernet/ibm/ibmveth.c +++ b/drivers/net/ethernet/ibm/ibmveth.c @@ -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; |