linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arch/sh/mm/consistent.c: Use dma_zalloc_coherent
@ 2018-10-28  6:58 Sabyasachi Gupta
  2019-01-20 13:08 ` Souptick Joarder
  2019-01-21 11:43 ` Robin Murphy
  0 siblings, 2 replies; 3+ messages in thread
From: Sabyasachi Gupta @ 2018-10-28  6:58 UTC (permalink / raw)
  To: ysato, dalias, thomas.petazzoni, robin.murphy, jacopo+renesas
  Cc: jrdr.linux, linux-sh, linux-kernel, brajeswar.linux

Replaced dma_alloc_coherent + memset with dma_zalloc_coherant

Signed-off-by: Sabyasachi Gupta <sabyasachi.linux@gmail.com>
---
 arch/sh/mm/consistent.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/sh/mm/consistent.c b/arch/sh/mm/consistent.c
index 792f361..fc8d235 100644
--- a/arch/sh/mm/consistent.c
+++ b/arch/sh/mm/consistent.c
@@ -52,13 +52,12 @@ int __init platform_resource_setup_memory(struct platform_device *pdev,
 	if (!memsize)
 		return 0;
 
-	buf = dma_alloc_coherent(&pdev->dev, memsize, &dma_handle, GFP_KERNEL);
+	buf = dma_zalloc_coherent(&pdev->dev, memsize, &dma_handle, GFP_KERNEL);
 	if (!buf) {
 		pr_warning("%s: unable to allocate memory\n", name);
 		return -ENOMEM;
 	}
 
-	memset(buf, 0, memsize);
 
 	r->flags = IORESOURCE_MEM;
 	r->start = dma_handle;
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] arch/sh/mm/consistent.c: Use dma_zalloc_coherent
  2018-10-28  6:58 [PATCH] arch/sh/mm/consistent.c: Use dma_zalloc_coherent Sabyasachi Gupta
@ 2019-01-20 13:08 ` Souptick Joarder
  2019-01-21 11:43 ` Robin Murphy
  1 sibling, 0 replies; 3+ messages in thread
From: Souptick Joarder @ 2019-01-20 13:08 UTC (permalink / raw)
  To: Sabyasachi Gupta
  Cc: Yoshinori Sato, dalias, thomas.petazzoni, robin.murphy,
	jacopo+renesas, linux-sh, linux-kernel, Brajeswar Ghosh

On Sun, Oct 28, 2018 at 12:29 PM Sabyasachi Gupta
<sabyasachi.linux@gmail.com> wrote:
>
> Replaced dma_alloc_coherent + memset with dma_zalloc_coherant
>
> Signed-off-by: Sabyasachi Gupta <sabyasachi.linux@gmail.com>

Acked-by: Souptick Joarder <jrdr.linux@gmail.com>

> ---
>  arch/sh/mm/consistent.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/arch/sh/mm/consistent.c b/arch/sh/mm/consistent.c
> index 792f361..fc8d235 100644
> --- a/arch/sh/mm/consistent.c
> +++ b/arch/sh/mm/consistent.c
> @@ -52,13 +52,12 @@ int __init platform_resource_setup_memory(struct platform_device *pdev,
>         if (!memsize)
>                 return 0;
>
> -       buf = dma_alloc_coherent(&pdev->dev, memsize, &dma_handle, GFP_KERNEL);
> +       buf = dma_zalloc_coherent(&pdev->dev, memsize, &dma_handle, GFP_KERNEL);
>         if (!buf) {
>                 pr_warning("%s: unable to allocate memory\n", name);
>                 return -ENOMEM;
>         }
>
> -       memset(buf, 0, memsize);
>
>         r->flags = IORESOURCE_MEM;
>         r->start = dma_handle;
> --
> 2.7.4
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] arch/sh/mm/consistent.c: Use dma_zalloc_coherent
  2018-10-28  6:58 [PATCH] arch/sh/mm/consistent.c: Use dma_zalloc_coherent Sabyasachi Gupta
  2019-01-20 13:08 ` Souptick Joarder
@ 2019-01-21 11:43 ` Robin Murphy
  1 sibling, 0 replies; 3+ messages in thread
From: Robin Murphy @ 2019-01-21 11:43 UTC (permalink / raw)
  To: Sabyasachi Gupta, ysato, dalias, thomas.petazzoni, jacopo+renesas
  Cc: jrdr.linux, linux-sh, linux-kernel, brajeswar.linux

On 28/10/2018 06:58, Sabyasachi Gupta wrote:
> Replaced dma_alloc_coherent + memset with dma_zalloc_coherant

Please take a look at linux-next where we've already phased out
dma_zalloc_coherent(). The memset() should still be redundant and worth
cleaning up, though.

Thanks,
Robin.

> Signed-off-by: Sabyasachi Gupta <sabyasachi.linux@gmail.com>
> ---
>   arch/sh/mm/consistent.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/arch/sh/mm/consistent.c b/arch/sh/mm/consistent.c
> index 792f361..fc8d235 100644
> --- a/arch/sh/mm/consistent.c
> +++ b/arch/sh/mm/consistent.c
> @@ -52,13 +52,12 @@ int __init platform_resource_setup_memory(struct platform_device *pdev,
>   if (!memsize)
>   return 0;
>
> -buf = dma_alloc_coherent(&pdev->dev, memsize, &dma_handle, GFP_KERNEL);
> +buf = dma_zalloc_coherent(&pdev->dev, memsize, &dma_handle, GFP_KERNEL);
>   if (!buf) {
>   pr_warning("%s: unable to allocate memory\n", name);
>   return -ENOMEM;
>   }
>
> -memset(buf, 0, memsize);
>
>   r->flags = IORESOURCE_MEM;
>   r->start = dma_handle;
>
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-01-21 11:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-28  6:58 [PATCH] arch/sh/mm/consistent.c: Use dma_zalloc_coherent Sabyasachi Gupta
2019-01-20 13:08 ` Souptick Joarder
2019-01-21 11:43 ` Robin Murphy

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).