diff mbox series

crypto: hisilicon/qm - delete redundant code

Message ID 1616721272-47909-1-git-send-email-yekai13@huawei.com (mailing list archive)
State Changes Requested
Delegated to: Herbert Xu
Headers show
Series crypto: hisilicon/qm - delete redundant code | expand

Commit Message

yekai (A) March 26, 2021, 1:14 a.m. UTC
The memory not needed to clear that will be freed. and the memset is useless
after the dma is freed.

Signed-off-by: Kai Ye <yekai13@huawei.com>
---
 drivers/crypto/hisilicon/qm.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Herbert Xu April 2, 2021, 7 a.m. UTC | #1
On Fri, Mar 26, 2021 at 09:14:32AM +0800, Kai Ye wrote:
> The memory not needed to clear that will be freed. and the memset is useless
> after the dma is freed.

I don't doubt that this memory probably doesn't need to be zeroed
since all it contains is a bunch of pointers instead of actual data.

But your patch description is poorly written and needs to be
rephrased to describe more clearly why it is safe to remove
the memset.

Thanks,
diff mbox series

Patch

diff --git a/drivers/crypto/hisilicon/qm.c b/drivers/crypto/hisilicon/qm.c
index 13cb421..88a6c6f 100644
--- a/drivers/crypto/hisilicon/qm.c
+++ b/drivers/crypto/hisilicon/qm.c
@@ -2527,7 +2527,6 @@  void hisi_qm_uninit(struct hisi_qm *qm)
 		hisi_qm_cache_wb(qm);
 		dma_free_coherent(dev, qm->qdma.size,
 				  qm->qdma.va, qm->qdma.dma);
-		memset(&qm->qdma, 0, sizeof(qm->qdma));
 	}
 
 	qm_irq_unregister(qm);