* [PATCH linux-next] powerpc/cell/axon_msi: Use dma_zalloc_coherent()
@ 2023-01-17 9:06 ye.xingchen
2023-01-17 20:04 ` Christophe JAILLET
0 siblings, 1 reply; 2+ messages in thread
From: ye.xingchen @ 2023-01-17 9:06 UTC (permalink / raw)
To: arnd; +Cc: linuxppc-dev, npiggin, linux-kernel
From: ye xingchen <ye.xingchen@zte.com.cn>
Instead of using dma_alloc_coherent() and memset() directly use
dma_zalloc_coherent().
Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
---
arch/powerpc/platforms/cell/axon_msi.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/platforms/cell/axon_msi.c b/arch/powerpc/platforms/cell/axon_msi.c
index 0c11aad896c7..8a4c522c8e67 100644
--- a/arch/powerpc/platforms/cell/axon_msi.c
+++ b/arch/powerpc/platforms/cell/axon_msi.c
@@ -358,8 +358,8 @@ static int axon_msi_probe(struct platform_device *device)
goto out_free_msic;
}
- msic->fifo_virt = dma_alloc_coherent(&device->dev, MSIC_FIFO_SIZE_BYTES,
- &msic->fifo_phys, GFP_KERNEL);
+ msic->fifo_virt = dma_zalloc_coherent(&device->dev, MSIC_FIFO_SIZE_BYTES,
+ &msic->fifo_phys, GFP_KERNEL);
if (!msic->fifo_virt) {
printk(KERN_ERR "axon_msi: couldn't allocate fifo for %pOF\n",
dn);
@@ -372,7 +372,6 @@ static int axon_msi_probe(struct platform_device *device)
dn);
goto out_free_fifo;
}
- memset(msic->fifo_virt, 0xff, MSIC_FIFO_SIZE_BYTES);
/* We rely on being able to stash a virq in a u16, so limit irqs to < 65536 */
msic->irq_domain = irq_domain_add_nomap(dn, 65536, &msic_host_ops, msic);
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH linux-next] powerpc/cell/axon_msi: Use dma_zalloc_coherent()
2023-01-17 9:06 [PATCH linux-next] powerpc/cell/axon_msi: Use dma_zalloc_coherent() ye.xingchen
@ 2023-01-17 20:04 ` Christophe JAILLET
0 siblings, 0 replies; 2+ messages in thread
From: Christophe JAILLET @ 2023-01-17 20:04 UTC (permalink / raw)
To: ye.xingchen, arnd; +Cc: linuxppc-dev, linux-kernel, npiggin
Le 17/01/2023 à 10:06, ye.xingchen@zte.com.cn a écrit :
> From: ye xingchen <ye.xingchen@zte.com.cn>
>
> Instead of using dma_alloc_coherent() and memset() directly use
> dma_zalloc_coherent().
>
Hi,
dma_zalloc_coherent() has been removed at the very beginning of 2019 in
commit dfd32cad146e.
It is not existing since v5.0-rc2.
\o/
CJ
> Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
> ---
> arch/powerpc/platforms/cell/axon_msi.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/arch/powerpc/platforms/cell/axon_msi.c b/arch/powerpc/platforms/cell/axon_msi.c
> index 0c11aad896c7..8a4c522c8e67 100644
> --- a/arch/powerpc/platforms/cell/axon_msi.c
> +++ b/arch/powerpc/platforms/cell/axon_msi.c
> @@ -358,8 +358,8 @@ static int axon_msi_probe(struct platform_device *device)
> goto out_free_msic;
> }
>
> - msic->fifo_virt = dma_alloc_coherent(&device->dev, MSIC_FIFO_SIZE_BYTES,
> - &msic->fifo_phys, GFP_KERNEL);
> + msic->fifo_virt = dma_zalloc_coherent(&device->dev, MSIC_FIFO_SIZE_BYTES,
> + &msic->fifo_phys, GFP_KERNEL);
> if (!msic->fifo_virt) {
> printk(KERN_ERR "axon_msi: couldn't allocate fifo for %pOF\n",
> dn);
> @@ -372,7 +372,6 @@ static int axon_msi_probe(struct platform_device *device)
> dn);
> goto out_free_fifo;
> }
> - memset(msic->fifo_virt, 0xff, MSIC_FIFO_SIZE_BYTES);
>
> /* We rely on being able to stash a virq in a u16, so limit irqs to < 65536 */
> msic->irq_domain = irq_domain_add_nomap(dn, 65536, &msic_host_ops, msic);
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-01-17 21:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-17 9:06 [PATCH linux-next] powerpc/cell/axon_msi: Use dma_zalloc_coherent() ye.xingchen
2023-01-17 20:04 ` Christophe JAILLET
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).