From patchwork Thu Dec 1 19:55:45 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Souptick Joarder X-Patchwork-Id: 9457585 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2EB9060235 for ; Fri, 2 Dec 2016 01:13:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 217812845D for ; Fri, 2 Dec 2016 01:13:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 169C128504; Fri, 2 Dec 2016 01:13:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B46792845D for ; Fri, 2 Dec 2016 01:13:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6777289276; Fri, 2 Dec 2016 01:12:16 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pg0-x243.google.com (mail-pg0-x243.google.com [IPv6:2607:f8b0:400e:c05::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id 668FF6E883 for ; Thu, 1 Dec 2016 19:55:49 +0000 (UTC) Received: by mail-pg0-x243.google.com with SMTP id 3so5516005pgd.0 for ; Thu, 01 Dec 2016 11:55:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=ifKH+MUD7MC31XZCFMnxTf19VngV2y2gVgnjY1uSaV8=; b=apwEx/AA/9rYSrvBZekGfm+8KdFAABHO6VDYEtQIn6X38VhZtFTkGyjKiMI2dpccuM 2NU8K7twvOS5Nj3LG8b7z7nqNhxd0RRCQyt/K842rWFgBsifL/u9o50L1Y7sG1Fq5TS9 3EAz0KhBPJwKW+40wSr7z2K4gPkNvin/RGkTFQI46Np+vDVgG4wUO5NlOH0tiFLSM2Ob CCxUncM5IfJEsY5T1r24rONoCmb6B/jXlqTbwEootogbFm7AIGhkz7VCZe6lgjlyMc0s dQOXr7thSpFD8R5jP3pJSojM2TiABTknoeWgVb0J2uyLvloD9S7lGMgUnGMjgP7w2hh8 e3GA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=ifKH+MUD7MC31XZCFMnxTf19VngV2y2gVgnjY1uSaV8=; b=LzXd4hwn0u4jr15mQl1awogkB9DCC744aPsGtDnfpzPV5sMnWyy5pfBNgTiccx43Z7 nSUnuNSF0VB3/3s8bkJNKZPiiCmL0HE6dab+nCQxLXCH0Oo6bjxp+95Oy67nbXHQoSR3 It8jBw9tRiem27BDMgRpydAmgmjBjyEIqWwcY7IGCdBrz12FeJFjh+oTBP+Y7uApPn3l Sq6pfUTJxHdubHC/K6AqO1a8PusuEYZz9MVi11u3fmIil0pu1jFHz+/SiZNUL4KR2rFc hTSiClnRhyofN5NA2LNSgpqMMo4PDib7l60ZQXCBrngg1zQnuzteH+P1rS2cNQJpsxPG 307w== X-Gm-Message-State: AKaTC02s0V6OUQJBcRIHKMfoJ3SrEKmgbWODixKzrgRDYRGkZwoxaelLhdAWyuHmYh8Pmg== X-Received: by 10.99.230.83 with SMTP id p19mr70957646pgj.138.1480622148844; Thu, 01 Dec 2016 11:55:48 -0800 (PST) Received: from jordon-HP-15-Notebook-PC ([106.51.142.83]) by smtp.gmail.com with ESMTPSA id g63sm2052562pfd.60.2016.12.01.11.55.47 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 01 Dec 2016 11:55:48 -0800 (PST) Date: Fri, 2 Dec 2016 01:25:45 +0530 From: Souptick Joarder To: linux-graphics-maintainer@vmware.com, syeh@vmware.com, thellstrom@vmware.com Subject: [PATCH] gpu: vmwgfx: Use dma_pool_zalloc Message-ID: <20161201195545.GA3696@jordon-HP-15-Notebook-PC> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Mailman-Approved-At: Fri, 02 Dec 2016 01:12:15 +0000 Cc: sahu.rameshwar73@gmail.com, dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP We should use dma_pool_zalloc instead of dma_pool_alloc/memset Signed-off-by: Souptick joarder Reviewed-by: Sinclair Yeh --- drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) -- 1.9.1 diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c b/drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c index aa04fb0..fa097cc 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c @@ -784,8 +784,8 @@ static int vmw_cmdbuf_space_pool(struct vmw_cmdbuf_man *man, if (ret) return ret; - header->cb_header = dma_pool_alloc(man->headers, GFP_KERNEL, - &header->handle); + header->cb_header = dma_pool_zalloc(man->headers, GFP_KERNEL, + &header->handle); if (!header->cb_header) { ret = -ENOMEM; goto out_no_cb_header; @@ -795,7 +795,6 @@ static int vmw_cmdbuf_space_pool(struct vmw_cmdbuf_man *man, cb_hdr = header->cb_header; offset = header->node.start << PAGE_SHIFT; header->cmd = man->map + offset; - memset(cb_hdr, 0, sizeof(*cb_hdr)); if (man->using_mob) { cb_hdr->flags = SVGA_CB_FLAG_MOB; cb_hdr->ptr.mob.mobid = man->cmd_space->mem.start; @@ -832,8 +831,8 @@ static int vmw_cmdbuf_space_inline(struct vmw_cmdbuf_man *man, if (WARN_ON_ONCE(size > VMW_CMDBUF_INLINE_SIZE)) return -ENOMEM; - dheader = dma_pool_alloc(man->dheaders, GFP_KERNEL, - &header->handle); + dheader = dma_pool_zalloc(man->dheaders, GFP_KERNEL, + &header->handle); if (!dheader) return -ENOMEM; @@ -842,7 +841,6 @@ static int vmw_cmdbuf_space_inline(struct vmw_cmdbuf_man *man, cb_hdr = &dheader->cb_header; header->cb_header = cb_hdr; header->cmd = dheader->cmd; - memset(dheader, 0, sizeof(*dheader)); cb_hdr->status = SVGA_CB_STATUS_NONE; cb_hdr->flags = SVGA_CB_FLAG_NONE; cb_hdr->ptr.pa = (u64)header->handle +