All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] crypto: ccp - use kmem_cache_zalloc instead of kmem_cache_alloc/memset
@ 2016-09-15  3:28 Wei Yongjun
  2016-09-19 15:10 ` Gary R Hook
  2016-09-22 10:43 ` Herbert Xu
  0 siblings, 2 replies; 3+ messages in thread
From: Wei Yongjun @ 2016-09-15  3:28 UTC (permalink / raw)
  To: Tom Lendacky, Gary Hook, Herbert Xu; +Cc: Wei Yongjun, linux-crypto

From: Wei Yongjun <weiyongjun1@huawei.com>

Using kmem_cache_zalloc() instead of kmem_cache_alloc() and memset().

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/crypto/ccp/ccp-dmaengine.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/crypto/ccp/ccp-dmaengine.c b/drivers/crypto/ccp/ccp-dmaengine.c
index ded26f4..2e5a05c 100644
--- a/drivers/crypto/ccp/ccp-dmaengine.c
+++ b/drivers/crypto/ccp/ccp-dmaengine.c
@@ -299,12 +299,10 @@ static struct ccp_dma_desc *ccp_alloc_dma_desc(struct ccp_dma_chan *chan,
 {
 	struct ccp_dma_desc *desc;
 
-	desc = kmem_cache_alloc(chan->ccp->dma_desc_cache, GFP_NOWAIT);
+	desc = kmem_cache_zalloc(chan->ccp->dma_desc_cache, GFP_NOWAIT);
 	if (!desc)
 		return NULL;
 
-	memset(desc, 0, sizeof(*desc));
-
 	dma_async_tx_descriptor_init(&desc->tx_desc, &chan->dma_chan);
 	desc->tx_desc.flags = flags;
 	desc->tx_desc.tx_submit = ccp_tx_submit;

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH -next] crypto: ccp - use kmem_cache_zalloc instead of kmem_cache_alloc/memset
  2016-09-15  3:28 [PATCH -next] crypto: ccp - use kmem_cache_zalloc instead of kmem_cache_alloc/memset Wei Yongjun
@ 2016-09-19 15:10 ` Gary R Hook
  2016-09-22 10:43 ` Herbert Xu
  1 sibling, 0 replies; 3+ messages in thread
From: Gary R Hook @ 2016-09-19 15:10 UTC (permalink / raw)
  To: Wei Yongjun, Tom Lendacky, Gary Hook, Herbert Xu
  Cc: Wei Yongjun, linux-crypto

On 09/14/2016 10:28 PM, Wei Yongjun wrote:
> From: Wei Yongjun <weiyongjun1@huawei.com>
>
> Using kmem_cache_zalloc() instead of kmem_cache_alloc() and memset().
>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
>  drivers/crypto/ccp/ccp-dmaengine.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/crypto/ccp/ccp-dmaengine.c b/drivers/crypto/ccp/ccp-dmaengine.c
> index ded26f4..2e5a05c 100644
> --- a/drivers/crypto/ccp/ccp-dmaengine.c
> +++ b/drivers/crypto/ccp/ccp-dmaengine.c
> @@ -299,12 +299,10 @@ static struct ccp_dma_desc *ccp_alloc_dma_desc(struct ccp_dma_chan *chan,
>  {
>  	struct ccp_dma_desc *desc;
>
> -	desc = kmem_cache_alloc(chan->ccp->dma_desc_cache, GFP_NOWAIT);
> +	desc = kmem_cache_zalloc(chan->ccp->dma_desc_cache, GFP_NOWAIT);
>  	if (!desc)
>  		return NULL;
>
> -	memset(desc, 0, sizeof(*desc));
> -
>  	dma_async_tx_descriptor_init(&desc->tx_desc, &chan->dma_chan);
>  	desc->tx_desc.flags = flags;
>  	desc->tx_desc.tx_submit = ccp_tx_submit;
>

Acked-by: Gary R Hook <gary.hook@amd.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH -next] crypto: ccp - use kmem_cache_zalloc instead of kmem_cache_alloc/memset
  2016-09-15  3:28 [PATCH -next] crypto: ccp - use kmem_cache_zalloc instead of kmem_cache_alloc/memset Wei Yongjun
  2016-09-19 15:10 ` Gary R Hook
@ 2016-09-22 10:43 ` Herbert Xu
  1 sibling, 0 replies; 3+ messages in thread
From: Herbert Xu @ 2016-09-22 10:43 UTC (permalink / raw)
  To: Wei Yongjun; +Cc: Tom Lendacky, Gary Hook, Wei Yongjun, linux-crypto

On Thu, Sep 15, 2016 at 03:28:04AM +0000, Wei Yongjun wrote:
> From: Wei Yongjun <weiyongjun1@huawei.com>
> 
> Using kmem_cache_zalloc() instead of kmem_cache_alloc() and memset().
> 
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

Patch applied.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-09-22 10:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-15  3:28 [PATCH -next] crypto: ccp - use kmem_cache_zalloc instead of kmem_cache_alloc/memset Wei Yongjun
2016-09-19 15:10 ` Gary R Hook
2016-09-22 10:43 ` Herbert Xu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.