2019-07-15 03:20:38

by Fuqian Huang

[permalink] [raw]
Subject: [PATCH v3 10/24] IB/mthca: Remove call to memset after dma_alloc_coherent

In commit 518a2f1925c3
("dma-mapping: zero memory returned from dma_alloc_*"),
dma_alloc_coherent has already zeroed the memory.
So memset is not needed.

Signed-off-by: Fuqian Huang <[email protected]>
---
Changes in v3:
- Use actual commit rather than the merge commit in the commit message

drivers/infiniband/hw/mthca/mthca_allocator.c | 2 --
1 file changed, 2 deletions(-)

diff --git a/drivers/infiniband/hw/mthca/mthca_allocator.c b/drivers/infiniband/hw/mthca/mthca_allocator.c
index aaf10dd5364d..aef1d274a14e 100644
--- a/drivers/infiniband/hw/mthca/mthca_allocator.c
+++ b/drivers/infiniband/hw/mthca/mthca_allocator.c
@@ -214,8 +214,6 @@ int mthca_buf_alloc(struct mthca_dev *dev, int size, int max_direct,

dma_unmap_addr_set(&buf->direct, mapping, t);

- memset(buf->direct.buf, 0, size);
-
while (t & ((1 << shift) - 1)) {
--shift;
npages *= 2;
--
2.11.0