Commit a02f6da6 authored by Souptick Joarder's avatar Souptick Joarder Committed by Sinclair Yeh

drm/vmwgfx: Use dma_pool_zalloc

We should use dma_pool_zalloc instead of dma_pool_alloc/memset
Signed-off-by: default avatarSouptick joarder <jrdr.linux@gmail.com>
Reviewed-by: default avatarSinclair Yeh <syeh@vmware.com>
Signed-off-by: default avatarSinclair Yeh <syeh@vmware.com>
parent d7f48231
...@@ -778,7 +778,7 @@ static int vmw_cmdbuf_space_pool(struct vmw_cmdbuf_man *man, ...@@ -778,7 +778,7 @@ static int vmw_cmdbuf_space_pool(struct vmw_cmdbuf_man *man,
if (ret) if (ret)
return ret; return ret;
header->cb_header = dma_pool_alloc(man->headers, GFP_KERNEL, header->cb_header = dma_pool_zalloc(man->headers, GFP_KERNEL,
&header->handle); &header->handle);
if (!header->cb_header) { if (!header->cb_header) {
ret = -ENOMEM; ret = -ENOMEM;
...@@ -789,7 +789,6 @@ static int vmw_cmdbuf_space_pool(struct vmw_cmdbuf_man *man, ...@@ -789,7 +789,6 @@ static int vmw_cmdbuf_space_pool(struct vmw_cmdbuf_man *man,
cb_hdr = header->cb_header; cb_hdr = header->cb_header;
offset = header->node.start << PAGE_SHIFT; offset = header->node.start << PAGE_SHIFT;
header->cmd = man->map + offset; header->cmd = man->map + offset;
memset(cb_hdr, 0, sizeof(*cb_hdr));
if (man->using_mob) { if (man->using_mob) {
cb_hdr->flags = SVGA_CB_FLAG_MOB; cb_hdr->flags = SVGA_CB_FLAG_MOB;
cb_hdr->ptr.mob.mobid = man->cmd_space->mem.start; cb_hdr->ptr.mob.mobid = man->cmd_space->mem.start;
...@@ -826,7 +825,7 @@ static int vmw_cmdbuf_space_inline(struct vmw_cmdbuf_man *man, ...@@ -826,7 +825,7 @@ static int vmw_cmdbuf_space_inline(struct vmw_cmdbuf_man *man,
if (WARN_ON_ONCE(size > VMW_CMDBUF_INLINE_SIZE)) if (WARN_ON_ONCE(size > VMW_CMDBUF_INLINE_SIZE))
return -ENOMEM; return -ENOMEM;
dheader = dma_pool_alloc(man->dheaders, GFP_KERNEL, dheader = dma_pool_zalloc(man->dheaders, GFP_KERNEL,
&header->handle); &header->handle);
if (!dheader) if (!dheader)
return -ENOMEM; return -ENOMEM;
...@@ -836,7 +835,6 @@ static int vmw_cmdbuf_space_inline(struct vmw_cmdbuf_man *man, ...@@ -836,7 +835,6 @@ static int vmw_cmdbuf_space_inline(struct vmw_cmdbuf_man *man,
cb_hdr = &dheader->cb_header; cb_hdr = &dheader->cb_header;
header->cb_header = cb_hdr; header->cb_header = cb_hdr;
header->cmd = dheader->cmd; header->cmd = dheader->cmd;
memset(dheader, 0, sizeof(*dheader));
cb_hdr->status = SVGA_CB_STATUS_NONE; cb_hdr->status = SVGA_CB_STATUS_NONE;
cb_hdr->flags = SVGA_CB_FLAG_NONE; cb_hdr->flags = SVGA_CB_FLAG_NONE;
cb_hdr->ptr.pa = (u64)header->handle + cb_hdr->ptr.pa = (u64)header->handle +
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment