From patchwork Thu Dec 9 22:03:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 12668357 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 15878C433FE for ; Thu, 9 Dec 2021 22:03:08 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 760F510E396; Thu, 9 Dec 2021 22:03:07 +0000 (UTC) Received: from smtp.smtpout.orange.fr (smtp07.smtpout.orange.fr [80.12.242.129]) by gabe.freedesktop.org (Postfix) with ESMTPS id B82F310E396 for ; Thu, 9 Dec 2021 22:03:06 +0000 (UTC) Received: from ubuntu-CJ.sitez.s.ibrowse.com ([146.0.31.27]) by smtp.orange.fr with ESMTPA id vRVGmeNDKMNzvvRVHmHIOZ; Thu, 09 Dec 2021 23:03:04 +0100 X-ME-Helo: ubuntu-CJ.sitez.s.ibrowse.com X-ME-Auth: YWZlNiIxYWMyZDliZWIzOTcwYTEyYzlhMmU3ZiQ1M2U2MzfzZDfyZTMxZTBkMTYyNDBjNDJlZmQ3ZQ== X-ME-Date: Thu, 09 Dec 2021 23:03:04 +0100 X-ME-IP: 146.0.31.27 From: Christophe JAILLET To: maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@linux.ie, daniel@ffwll.ch Subject: [PATCH] drm: Remove some useless memset Date: Thu, 9 Dec 2021 23:03:00 +0100 Message-Id: X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christophe JAILLET , kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 'bufs' is an array embedded in an structure (struct drm_device_dma) which is kzalloc just a few lines above. So there is no need to explicitly memset each element on the array. It is already cleared. Remove the useless memset. Signed-off-by: Christophe JAILLET --- drivers/gpu/drm/drm_dma.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/gpu/drm/drm_dma.c b/drivers/gpu/drm/drm_dma.c index eb6b741a6f99..df4837dc5030 100644 --- a/drivers/gpu/drm/drm_dma.c +++ b/drivers/gpu/drm/drm_dma.c @@ -51,8 +51,6 @@ */ int drm_legacy_dma_setup(struct drm_device *dev) { - int i; - if (!drm_core_check_feature(dev, DRIVER_HAVE_DMA) || !drm_core_check_feature(dev, DRIVER_LEGACY)) return 0; @@ -64,9 +62,6 @@ int drm_legacy_dma_setup(struct drm_device *dev) if (!dev->dma) return -ENOMEM; - for (i = 0; i <= DRM_MAX_ORDER; i++) - memset(&dev->dma->bufs[i], 0, sizeof(dev->dma->bufs[0])); - return 0; }