From patchwork Mon Aug 27 07:07:43 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 1376831 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id 4D4BA3FC71 for ; Mon, 27 Aug 2012 08:13:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 41CF49EF5F for ; Mon, 27 Aug 2012 01:13:12 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qa0-f42.google.com (mail-qa0-f42.google.com [209.85.216.42]) by gabe.freedesktop.org (Postfix) with ESMTP id 71E869E80D for ; Mon, 27 Aug 2012 00:07:44 -0700 (PDT) Received: by qaeb19 with SMTP id b19so1564793qae.15 for ; Mon, 27 Aug 2012 00:07:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:cc:content-type; bh=D339FH/uB/HGpkAOHCplU+2NopsoPI2Gs5WmsgxOIJs=; b=garjFnp8J5VWSXNhsJ8gY3BfvuhZ96i1LzU/e/pvMnxhpC45WrK1YWLd1Bclb3VJUD cKiggvlqGZNg5heOmO07UEnw0cYAr0sYDr9y1/ci3MeIuFMGPmlFIPF3LTpQtTVSVb6a GBSWBunlThVEx55mZqajBzRZ4Nhj+SXDqOkPwUPf8g1wNCHQzcVkmSYpWAd6Raj8CvuY 6QrhRWM1n4AwjC/zW8Lb7TV/JFezc9sZpVsg30zH8i51u4b9xz9wOkVEdKK8xBkW9V81 r9kx09cV/aoN7O37bQ3VNYpc+ji0ekMIr7/pk2Hi5fS7gZEl1DQ2267YuGmnGWTabPeZ dO4w== MIME-Version: 1.0 Received: by 10.224.193.132 with SMTP id du4mr22023980qab.75.1346051263978; Mon, 27 Aug 2012 00:07:43 -0700 (PDT) Received: by 10.229.146.194 with HTTP; Mon, 27 Aug 2012 00:07:43 -0700 (PDT) Date: Mon, 27 Aug 2012 15:07:43 +0800 Message-ID: Subject: [PATCH] vmwgfx: remove useless set memory to zero use memset() From: Wei Yongjun To: airlied@linux.ie X-Mailman-Approved-At: Mon, 27 Aug 2012 01:12:12 -0700 Cc: yongjun_wei@trendmicro.com.cn, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org From: Wei Yongjun 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 --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 1 - drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 1 - 2 files changed, 2 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c index 4d9edea..3e47f75 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c @@ -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); diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c index c50724b..5474394 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c @@ -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));