Skip to content

Commit bfb5eb0

Browse files
WillLesterherbertx
authored andcommitted
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 <[email protected]> Acked-by: Gary R Hook <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent 6ed0109 commit bfb5eb0

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/crypto/ccp/ccp-ops.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,14 +150,13 @@ static int ccp_init_dm_workarea(struct ccp_dm_workarea *wa,
150150
if (len <= CCP_DMAPOOL_MAX_SIZE) {
151151
wa->dma_pool = cmd_q->dma_pool;
152152

153-
wa->address = dma_pool_alloc(wa->dma_pool, GFP_KERNEL,
153+
wa->address = dma_pool_zalloc(wa->dma_pool, GFP_KERNEL,
154154
&wa->dma.address);
155155
if (!wa->address)
156156
return -ENOMEM;
157157

158158
wa->dma.length = CCP_DMAPOOL_MAX_SIZE;
159159

160-
memset(wa->address, 0, CCP_DMAPOOL_MAX_SIZE);
161160
} else {
162161
wa->address = kzalloc(len, GFP_KERNEL);
163162
if (!wa->address)

0 commit comments

Comments
 (0)