From: Daniel Vetter <daniel@ffwll.ch>
To: Souptick Joarder <jrdr.linux@gmail.com>
Cc: gustavo@padovan.org, maarten.lankhorst@linux.intel.com,
sean@poorly.run, airlied@linux.ie, brajeswar.linux@gmail.com,
linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
sabyasachi.linux@gmail.com
Subject: Re: [PATCH] drm/drm_pci.c: Use dma_zalloc_coherent
Date: Tue, 23 Oct 2018 15:58:55 +0200 [thread overview]
Message-ID: <20181023135855.GU324@phenom.ffwll.local> (raw)
In-Reply-To: <20181023040222.GA1540@jordon-HP-15-Notebook-PC>
On Tue, Oct 23, 2018 at 09:32:22AM +0530, Souptick Joarder wrote:
> Replace dma_alloc_coherent + memset with dma_zalloc_coherent.
>
> Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>
Applied, thanks for your patch.
-Daniel
> ---
> drivers/gpu/drm/drm_pci.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_pci.c b/drivers/gpu/drm/drm_pci.c
> index 896e42a..1427879 100644
> --- a/drivers/gpu/drm/drm_pci.c
> +++ b/drivers/gpu/drm/drm_pci.c
> @@ -61,15 +61,14 @@ drm_dma_handle_t *drm_pci_alloc(struct drm_device * dev, size_t size, size_t ali
> return NULL;
>
> dmah->size = size;
> - dmah->vaddr = dma_alloc_coherent(&dev->pdev->dev, size, &dmah->busaddr, GFP_KERNEL | __GFP_COMP);
> + dmah->vaddr = dma_zalloc_coherent(&dev->pdev->dev, size, &dmah->busaddr,
> + GFP_KERNEL | __GFP_COMP);
>
> if (dmah->vaddr == NULL) {
> kfree(dmah);
> return NULL;
> }
>
> - memset(dmah->vaddr, 0, size);
> -
> /* XXX - Is virt_to_page() legal for consistent mem? */
> /* Reserve */
> for (addr = (unsigned long)dmah->vaddr, sz = size;
> --
> 1.9.1
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
prev parent reply other threads:[~2018-10-23 13:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-23 4:02 Souptick Joarder
2018-10-23 13:58 ` Daniel Vetter [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181023135855.GU324@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=airlied@linux.ie \
--cc=brajeswar.linux@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=gustavo@padovan.org \
--cc=jrdr.linux@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=sabyasachi.linux@gmail.com \
--cc=sean@poorly.run \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome