ath10k: use dma_zalloc_coherent instead of allocator/memset

Use dma_zalloc_coherent instead of dma_alloc_coherent
followed by memset 0.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
This commit is contained in:
YueHaibing 2018-06-04 20:35:42 +08:00 committed by Kalle Valo
parent 5a21162700
commit 9fb31b66b9
1 changed files with 1 additions and 3 deletions

View File

@ -5018,13 +5018,11 @@ static int ath10k_wmi_alloc_chunk(struct ath10k *ar, u32 req_id,
void *vaddr; void *vaddr;
pool_size = num_units * round_up(unit_len, 4); pool_size = num_units * round_up(unit_len, 4);
vaddr = dma_alloc_coherent(ar->dev, pool_size, &paddr, GFP_KERNEL); vaddr = dma_zalloc_coherent(ar->dev, pool_size, &paddr, GFP_KERNEL);
if (!vaddr) if (!vaddr)
return -ENOMEM; return -ENOMEM;
memset(vaddr, 0, pool_size);
ar->wmi.mem_chunks[idx].vaddr = vaddr; ar->wmi.mem_chunks[idx].vaddr = vaddr;
ar->wmi.mem_chunks[idx].paddr = paddr; ar->wmi.mem_chunks[idx].paddr = paddr;
ar->wmi.mem_chunks[idx].len = pool_size; ar->wmi.mem_chunks[idx].len = pool_size;