Skip to content

Commit

Permalink
vmwgfx: remove useless set memory to zero use memset()
Browse files Browse the repository at this point in the history
The memory return by kzalloc() or kmem_cache_zalloc() has already
be set to zero, so remove useless memset(0).

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Dave Airlie <airlied@redhat.com>
  • Loading branch information
Wei Yongjun authored and Dave Airlie committed Sep 13, 2012
1 parent cd004b3 commit 3a99507
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 2 deletions.
1 change: 0 additions & 1 deletion drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,6 @@ static int vmw_driver_load(struct drm_device *dev, unsigned long chipset)
DRM_ERROR("Failed allocating a device private struct.\n");
return -ENOMEM;
}
memset(dev_priv, 0, sizeof(*dev_priv));

pci_set_master(dev->pdev);

Expand Down
1 change: 0 additions & 1 deletion drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,6 @@ static int do_surface_dirty_sou(struct vmw_private *dev_priv,
}

/* only need to do this once */
memset(cmd, 0, fifo_size);
cmd->header.id = cpu_to_le32(SVGA_3D_CMD_BLIT_SURFACE_TO_SCREEN);
cmd->header.size = cpu_to_le32(fifo_size - sizeof(cmd->header));

Expand Down

0 comments on commit 3a99507

Please sign in to comment.