dma_alloc_coherent() already clear the allocated memory, there is no need
to explicitly call memset().
Signed-off-by: Christophe JAILLET <[email protected]>
---
drivers/dma/idxd/device.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/dma/idxd/device.c b/drivers/dma/idxd/device.c
index 5abbcc61c528..7c74bc60f582 100644
--- a/drivers/dma/idxd/device.c
+++ b/drivers/dma/idxd/device.c
@@ -786,8 +786,6 @@ static int idxd_device_evl_setup(struct idxd_device *idxd)
goto err_alloc;
}
- memset(addr, 0, size);
-
spin_lock(&evl->lock);
evl->log = addr;
evl->dma = dma_addr;
--
2.34.1
On 5/28/23 07:11, Christophe JAILLET wrote:
> dma_alloc_coherent() already clear the allocated memory, there is no need
> to explicitly call memset().
>
> Signed-off-by: Christophe JAILLET <[email protected]>
Acked-by: Dave Jiang <[email protected]>
> ---
> drivers/dma/idxd/device.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/drivers/dma/idxd/device.c b/drivers/dma/idxd/device.c
> index 5abbcc61c528..7c74bc60f582 100644
> --- a/drivers/dma/idxd/device.c
> +++ b/drivers/dma/idxd/device.c
> @@ -786,8 +786,6 @@ static int idxd_device_evl_setup(struct idxd_device *idxd)
> goto err_alloc;
> }
>
> - memset(addr, 0, size);
> -
> spin_lock(&evl->lock);
> evl->log = addr;
> evl->dma = dma_addr;
On 5/28/23 07:11, Christophe JAILLET wrote:
> dma_alloc_coherent() already clear the allocated memory, there is no need
> to explicitly call memset().
>
> Signed-off-by: Christophe JAILLET <[email protected]>
Acked-by: Fenghua Yu <[email protected]>
Thanks.
-Fenghua
On 28/05/2023 16:11, Christophe JAILLET wrote:
> dma_alloc_coherent() already clear the allocated memory, there is no need
> to explicitly call memset().
Hmm, so wouldn't be dma_zalloc_coherent() a better name for the function?
Kind regards,
Bernd
--
Bernd Petrovitsch Email : [email protected]
There is NO CLOUD, just other people's computers. - FSFE
LUGA : http://www.luga.at
Le 30/05/2023 à 17:54, Bernd Petrovitsch a écrit :
> On 28/05/2023 16:11, Christophe JAILLET wrote:
>> dma_alloc_coherent() already clear the allocated memory, there is no need
>> to explicitly call memset().
>
> Hmm, so wouldn't be dma_zalloc_coherent() a better name for the function?
>
> Kind regards,
> Bernd
Hi,
No strong opinion about it.
It is not malloc either !)
When dma_zalloc_coherent() has been deprecated (see [1]), for some
reason, it was decided to keep the "alloc" version.
CJ
[1]:
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/include/linux/dma-mapping.h?id=06d4dd2f2ce1cdb625f77c0676d5af6ba310c01d
On Sun, 28 May 2023 16:11:54 +0200, Christophe JAILLET wrote:
> dma_alloc_coherent() already clear the allocated memory, there is no need
> to explicitly call memset().
>
>
Applied, thanks!
[1/1] dmaengine: idxd: No need to clear memory after a dma_alloc_coherent() call
commit: 61e2cd90681e91ee8202d22e5ca25b1100557fc4
Best regards,
--
~Vinod