diff options
author | YueHaibing <yuehaibing@huawei.com> | 2018-06-03 04:40:15 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-06-04 22:07:30 +0200 |
commit | 40434a670f66f797b3a40603a286def35337dd4f (patch) | |
tree | 177e1c79faf67d0a76d85503e16008896a6e3867 /drivers/net/ethernet/chelsio/cxgb4 | |
parent | rxrpc: Fix handling of call quietly cancelled out on server (diff) | |
download | linux-40434a670f66f797b3a40603a286def35337dd4f.tar.xz linux-40434a670f66f797b3a40603a286def35337dd4f.zip |
net: chelsio: Use zeroing memory allocator instead of allocator/memset
Use dma_zalloc_coherent for allocating zeroed
memory and remove unnecessary memset function.
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/chelsio/cxgb4')
-rw-r--r-- | drivers/net/ethernet/chelsio/cxgb4/sge.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/net/ethernet/chelsio/cxgb4/sge.c b/drivers/net/ethernet/chelsio/cxgb4/sge.c index 276f22357f81..7a271feec5e7 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/sge.c +++ b/drivers/net/ethernet/chelsio/cxgb4/sge.c @@ -694,7 +694,7 @@ static void *alloc_ring(struct device *dev, size_t nelem, size_t elem_size, { size_t len = nelem * elem_size + stat_size; void *s = NULL; - void *p = dma_alloc_coherent(dev, len, phys, GFP_KERNEL); + void *p = dma_zalloc_coherent(dev, len, phys, GFP_KERNEL); if (!p) return NULL; @@ -708,7 +708,6 @@ static void *alloc_ring(struct device *dev, size_t nelem, size_t elem_size, } if (metadata) *(void **)metadata = s; - memset(p, 0, len); return p; } |