Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Chuhong Yuan and committed by
Herbert Xu
bfb5eb08 6ed01097

+1 -2
+1 -2
drivers/crypto/ccp/ccp-ops.c
··· 150 150 if (len <= CCP_DMAPOOL_MAX_SIZE) { 151 151 wa->dma_pool = cmd_q->dma_pool; 152 152 153 - wa->address = dma_pool_alloc(wa->dma_pool, GFP_KERNEL, 153 + wa->address = dma_pool_zalloc(wa->dma_pool, GFP_KERNEL, 154 154 &wa->dma.address); 155 155 if (!wa->address) 156 156 return -ENOMEM; 157 157 158 158 wa->dma.length = CCP_DMAPOOL_MAX_SIZE; 159 159 160 - memset(wa->address, 0, CCP_DMAPOOL_MAX_SIZE); 161 160 } else { 162 161 wa->address = kzalloc(len, GFP_KERNEL); 163 162 if (!wa->address)