linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gary R Hook <ghook@amd.com>
To: Chuhong Yuan <hslester96@gmail.com>
Cc: "Lendacky, Thomas" <Thomas.Lendacky@amd.com>,
	"Hook, Gary" <Gary.Hook@amd.com>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	"David S . Miller" <davem@davemloft.net>,
	"linux-crypto@vger.kernel.org" <linux-crypto@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] crypto: ccp - Replace dma_pool_alloc + memset with dma_pool_zalloc
Date: Thu, 18 Jul 2019 21:50:32 +0000	[thread overview]
Message-ID: <96cc55c8-16d1-7c2e-1a7c-2b73c5cfa267@amd.com> (raw)
In-Reply-To: <20190718131609.10974-1-hslester96@gmail.com>

On 7/18/19 8:16 AM, Chuhong Yuan wrote:
> 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>

> ---
>   drivers/crypto/ccp/ccp-ops.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/crypto/ccp/ccp-ops.c b/drivers/crypto/ccp/ccp-ops.c
> index 866b2e05ca77..03797c42b336 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)
> 


  reply	other threads:[~2019-07-18 21:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-18 13:16 [PATCH] crypto: ccp - Replace dma_pool_alloc + memset with dma_pool_zalloc Chuhong Yuan
2019-07-18 21:50 ` Gary R Hook [this message]
2019-07-26 12:35 ` Herbert Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=96cc55c8-16d1-7c2e-1a7c-2b73c5cfa267@amd.com \
    --to=ghook@amd.com \
    --cc=Gary.Hook@amd.com \
    --cc=Thomas.Lendacky@amd.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=hslester96@gmail.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).