diff mbox

[2/2] dmaengine: k3dma: move to dma_pool_zalloc

Message ID 1481083829-12259-1-git-send-email-vinod.koul@intel.com (mailing list archive)
State Accepted
Headers show

Commit Message

Vinod Koul Dec. 7, 2016, 4:10 a.m. UTC
Replace dma_pool_alloc & memset with dma_pool_zalloc.

Cc: Zhangfei Gao <zhangfei.gao@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
 drivers/dma/k3dma.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Zhangfei Gao Dec. 7, 2016, 5:08 a.m. UTC | #1
On 2016年12月07日 12:10, Vinod Koul wrote:
> Replace dma_pool_alloc & memset with dma_pool_zalloc.
>
> Cc: Zhangfei Gao <zhangfei.gao@linaro.org>
> Signed-off-by: Vinod Koul <vinod.koul@intel.com>

Acked-by: Zhangfei Gao <zhangfei.gao@linaro.org>

Thanks
> ---
>   drivers/dma/k3dma.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/dma/k3dma.c b/drivers/dma/k3dma.c
> index aabcb7934b05..01e25c68dd5a 100644
> --- a/drivers/dma/k3dma.c
> +++ b/drivers/dma/k3dma.c
> @@ -458,13 +458,12 @@ static struct k3_dma_desc_sw *k3_dma_alloc_desc_resource(int num,
>   	if (!ds)
>   		return NULL;
>   
> -	ds->desc_hw = dma_pool_alloc(d->pool, GFP_NOWAIT, &ds->desc_hw_lli);
> +	ds->desc_hw = dma_pool_zalloc(d->pool, GFP_NOWAIT, &ds->desc_hw_lli);
>   	if (!ds->desc_hw) {
>   		dev_dbg(chan->device->dev, "vch %p: dma alloc fail\n", &c->vc);
>   		kfree(ds);
>   		return NULL;
>   	}
> -	memset(ds->desc_hw, 0, sizeof(struct k3_desc_hw) * num);
>   	ds->desc_num = num;
>   	return ds;
>   }

--
To unsubscribe from this list: send the line "unsubscribe dmaengine" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/dma/k3dma.c b/drivers/dma/k3dma.c
index aabcb7934b05..01e25c68dd5a 100644
--- a/drivers/dma/k3dma.c
+++ b/drivers/dma/k3dma.c
@@ -458,13 +458,12 @@  static struct k3_dma_desc_sw *k3_dma_alloc_desc_resource(int num,
 	if (!ds)
 		return NULL;
 
-	ds->desc_hw = dma_pool_alloc(d->pool, GFP_NOWAIT, &ds->desc_hw_lli);
+	ds->desc_hw = dma_pool_zalloc(d->pool, GFP_NOWAIT, &ds->desc_hw_lli);
 	if (!ds->desc_hw) {
 		dev_dbg(chan->device->dev, "vch %p: dma alloc fail\n", &c->vc);
 		kfree(ds);
 		return NULL;
 	}
-	memset(ds->desc_hw, 0, sizeof(struct k3_desc_hw) * num);
 	ds->desc_num = num;
 	return ds;
 }