dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Sinclair Yeh <syeh@vmware.com>
To: Souptick Joarder <jrdr.linux@gmail.com>
Cc: thellstrom@vmware.com, linux-graphics-maintainer@vmware.com,
	sahu.rameshwar73@gmail.com, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] gpu: vmwgfx: Use dma_pool_zalloc
Date: Thu, 1 Dec 2016 17:32:50 -0800	[thread overview]
Message-ID: <20161202013250.GA9486@vmware.com> (raw)
In-Reply-To: <20161201195545.GA3696@jordon-HP-15-Notebook-PC>

Applied.  Thanks.

Reviewed-by: Sinclair Yeh <syeh@vmware.com>

On Fri, Dec 02, 2016 at 01:25:45AM +0530, Souptick Joarder wrote:
> We should use dma_pool_zalloc instead of dma_pool_alloc/memset
> 
> Signed-off-by: Souptick joarder <jrdr.linux@gmail.com>
> ---
>  drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c b/drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c
> index aa04fb0..fa097cc 100644
> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c
> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c
> @@ -784,8 +784,8 @@ static int vmw_cmdbuf_space_pool(struct vmw_cmdbuf_man *man,
>  	if (ret)
>  		return ret;
> 
> -	header->cb_header = dma_pool_alloc(man->headers, GFP_KERNEL,
> -					   &header->handle);
> +	header->cb_header = dma_pool_zalloc(man->headers, GFP_KERNEL,
> +					    &header->handle);
>  	if (!header->cb_header) {
>  		ret = -ENOMEM;
>  		goto out_no_cb_header;
> @@ -795,7 +795,6 @@ static int vmw_cmdbuf_space_pool(struct vmw_cmdbuf_man *man,
>  	cb_hdr = header->cb_header;
>  	offset = header->node.start << PAGE_SHIFT;
>  	header->cmd = man->map + offset;
> -	memset(cb_hdr, 0, sizeof(*cb_hdr));
>  	if (man->using_mob) {
>  		cb_hdr->flags = SVGA_CB_FLAG_MOB;
>  		cb_hdr->ptr.mob.mobid = man->cmd_space->mem.start;
> @@ -832,8 +831,8 @@ static int vmw_cmdbuf_space_inline(struct vmw_cmdbuf_man *man,
>  	if (WARN_ON_ONCE(size > VMW_CMDBUF_INLINE_SIZE))
>  		return -ENOMEM;
> 
> -	dheader = dma_pool_alloc(man->dheaders, GFP_KERNEL,
> -				 &header->handle);
> +	dheader = dma_pool_zalloc(man->dheaders, GFP_KERNEL,
> +				  &header->handle);
>  	if (!dheader)
>  		return -ENOMEM;
> 
> @@ -842,7 +841,6 @@ static int vmw_cmdbuf_space_inline(struct vmw_cmdbuf_man *man,
>  	cb_hdr = &dheader->cb_header;
>  	header->cb_header = cb_hdr;
>  	header->cmd = dheader->cmd;
> -	memset(dheader, 0, sizeof(*dheader));
>  	cb_hdr->status = SVGA_CB_STATUS_NONE;
>  	cb_hdr->flags = SVGA_CB_FLAG_NONE;
>  	cb_hdr->ptr.pa = (u64)header->handle +
> --
> 1.9.1
> 
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

      reply	other threads:[~2016-12-02  2:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-01 19:55 [PATCH] gpu: vmwgfx: Use dma_pool_zalloc Souptick Joarder
2016-12-02  1:32 ` Sinclair Yeh [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=20161202013250.GA9486@vmware.com \
    --to=syeh@vmware.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jrdr.linux@gmail.com \
    --cc=linux-graphics-maintainer@vmware.com \
    --cc=sahu.rameshwar73@gmail.com \
    --cc=thellstrom@vmware.com \
    /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;
as well as URLs for NNTP newsgroup(s).