vmwgfx: remove useless set memory to zero use memset()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Mon, 27 Aug 2012 07:07:43 +0000 (07:07 +0000)
committerDave Airlie <airlied@redhat.com>
Thu, 13 Sep 2012 01:34:34 +0000 (11:34 +1000)
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>
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c

index 4d9edead01acdbcb900a3fdca87d5ed08cdab682..3e47f7570861e64e7607864546dd595f0c4153ec 100644 (file)
@@ -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);
 
index c50724bd30f6e052e2f80e6f823379241944ff60..54743943d8b328320de41e231763b3878c4a4744 100644 (file)
@@ -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));