2023-07-21 07:56:24

by Ran Sun

[permalink] [raw]
Subject: [PATCH] dmaengine: idxd: No need to clear memory after a dma_alloc_coherent() call

dma_alloc_coherent() already clear the allocated memory, there is no
need
to explicitly call memset().

Signed-off-by: Ran Sun <[email protected]>
---
drivers/dma/idxd/device.c | 1 -
1 file changed, 1 deletion(-)

diff --git a/drivers/dma/idxd/device.c b/drivers/dma/idxd/device.c
index 7c74bc60f582..72330876d40a 100644
--- a/drivers/dma/idxd/device.c
+++ b/drivers/dma/idxd/device.c
@@ -792,7 +792,6 @@ static int idxd_device_evl_setup(struct idxd_device
*idxd)
evl->log_size = size;
evl->bmap = bmap;

- memset(&evlcfg, 0, sizeof(evlcfg));
evlcfg.bits[0] = dma_addr & GENMASK(63, 12);
evlcfg.size = evl->size;


2023-07-21 16:53:53

by Dave Jiang

[permalink] [raw]
Subject: Re: [PATCH] dmaengine: idxd: No need to clear memory after a dma_alloc_coherent() call



On 7/21/23 00:35, [email protected] wrote:
> dma_alloc_coherent() already clear the allocated memory, there is no need
> to explicitly call memset().
>
> Signed-off-by: Ran Sun <[email protected]>

Reviewed-by: Dave Jiang <[email protected]>
> ---
>  drivers/dma/idxd/device.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/drivers/dma/idxd/device.c b/drivers/dma/idxd/device.c
> index 7c74bc60f582..72330876d40a 100644
> --- a/drivers/dma/idxd/device.c
> +++ b/drivers/dma/idxd/device.c
> @@ -792,7 +792,6 @@ static int idxd_device_evl_setup(struct idxd_device
> *idxd)
>      evl->log_size = size;
>      evl->bmap = bmap;
>
> -    memset(&evlcfg, 0, sizeof(evlcfg));
>      evlcfg.bits[0] = dma_addr & GENMASK(63, 12);
>      evlcfg.size = evl->size;

2023-08-01 18:46:49

by Vinod Koul

[permalink] [raw]
Subject: Re: [PATCH] dmaengine: idxd: No need to clear memory after a dma_alloc_coherent() call

On 21-07-23, 07:35, [email protected] wrote:
> dma_alloc_coherent() already clear the allocated memory, there is no need
> to explicitly call memset().

Please fix the sender name and resend. it should match s-o-b name

>
> Signed-off-by: Ran Sun <[email protected]>
> ---
> drivers/dma/idxd/device.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/dma/idxd/device.c b/drivers/dma/idxd/device.c
> index 7c74bc60f582..72330876d40a 100644
> --- a/drivers/dma/idxd/device.c
> +++ b/drivers/dma/idxd/device.c
> @@ -792,7 +792,6 @@ static int idxd_device_evl_setup(struct idxd_device
> *idxd)
> evl->log_size = size;
> evl->bmap = bmap;
>
> - memset(&evlcfg, 0, sizeof(evlcfg));
> evlcfg.bits[0] = dma_addr & GENMASK(63, 12);
> evlcfg.size = evl->size;

--
~Vinod