diff options
author | Chuhong Yuan <hslester96@gmail.com> | 2019-07-18 15:16:09 +0200 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2019-07-27 13:08:33 +0200 |
commit | bfb5eb084ae93eb86d3b088c301500db138963e5 (patch) | |
tree | 99ebecf43627d16ac9a27dc6b6cbc36f376f4153 | |
parent | crypto: caam/qi2 - Increase napi budget to process more caam responses (diff) | |
download | linux-bfb5eb084ae93eb86d3b088c301500db138963e5.tar.xz linux-bfb5eb084ae93eb86d3b088c301500db138963e5.zip |
crypto: ccp - Replace dma_pool_alloc + memset with dma_pool_zalloc
Use dma_pool_zalloc instead of using dma_pool_alloc to allocate
memory and then zeroing it with memset 0.
This simplifies the code.
Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
Acked-by: Gary R Hook <gary.hook@amd.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r-- | drivers/crypto/ccp/ccp-ops.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/crypto/ccp/ccp-ops.c b/drivers/crypto/ccp/ccp-ops.c index acf4f653f25b..42d167574131 100644 --- a/drivers/crypto/ccp/ccp-ops.c +++ b/drivers/crypto/ccp/ccp-ops.c @@ -150,14 +150,13 @@ static int ccp_init_dm_workarea(struct ccp_dm_workarea *wa, if (len <= CCP_DMAPOOL_MAX_SIZE) { wa->dma_pool = cmd_q->dma_pool; - wa->address = dma_pool_alloc(wa->dma_pool, GFP_KERNEL, + wa->address = dma_pool_zalloc(wa->dma_pool, GFP_KERNEL, &wa->dma.address); if (!wa->address) return -ENOMEM; wa->dma.length = CCP_DMAPOOL_MAX_SIZE; - memset(wa->address, 0, CCP_DMAPOOL_MAX_SIZE); } else { wa->address = kzalloc(len, GFP_KERNEL); if (!wa->address) |