From patchwork Tue Oct 23 04:02:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Souptick Joarder X-Patchwork-Id: 10652755 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8D9BF14DE for ; Tue, 23 Oct 2018 07:02:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5D4E9292E9 for ; Tue, 23 Oct 2018 07:02:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 516F2292FD; Tue, 23 Oct 2018 07:02:58 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED 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 09ED1292E9 for ; Tue, 23 Oct 2018 07:02:58 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5A4356E0C0; Tue, 23 Oct 2018 07:02:54 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4BBAF89B00 for ; Tue, 23 Oct 2018 03:58:58 +0000 (UTC) Received: by mail-pg1-x544.google.com with SMTP id r9-v6so20025147pgv.6 for ; Mon, 22 Oct 2018 20:58:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=vrLzbMQB2qosUS+SNjOskqaK6dqBKdQNnSmc8vqPpEg=; b=MIVZQ9g/Yk3UbWHzhQ2xs6xwWAmXGJErQ2uGqEos+cNwrulnqJoMvvTVYejd6PQVHt klu0Atf0MWcQSeyfx6dzHUHIyyKSHbJbURx81pXpRgLUJnpizl5DGCJU9yfueEFHe/3T 8cOwh2vM3Qvx4q1I1LAno7MowYVo77ZEHXxnDRynJudvSyq+pCzxdX37Wt+IsuKsXWpA Op9de2ahKQd2+HZlUNZ9/yVPr58GRZgmyK2S5bMx9RyydLTyFJSsA4buH0LDObUlDVgk HL715cQV81mKvx21DLPBi4uB2oVizC6AVkq5GFC8RR1gWyJKIJeVMFT6hGlpsYXLe6LW OJFw== X-Gm-Message-State: AGRZ1gJqGyEEsvitUm3fM4EdXRJNTa9ddpijFY8PT2bIVVmtrUD4yo86 orHFRuzmm5Hd3SrbMNzSZxs= X-Google-Smtp-Source: AJdET5dot2rydcQ65AotXQ18iDrsB0AVl18JqDCOEE3LHffBNAiiSFeqcgQWZfpS/jNiWYPBs7O/sA== X-Received: by 2002:a63:515b:: with SMTP id r27-v6mr9535006pgl.419.1540267136804; Mon, 22 Oct 2018 20:58:56 -0700 (PDT) Received: from jordon-HP-15-Notebook-PC ([49.205.217.86]) by smtp.gmail.com with ESMTPSA id j25-v6sm38276365pff.116.2018.10.22.20.58.54 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 22 Oct 2018 20:58:55 -0700 (PDT) Date: Tue, 23 Oct 2018 09:32:22 +0530 From: Souptick Joarder To: gustavo@padovan.org, maarten.lankhorst@linux.intel.com, sean@poorly.run, airlied@linux.ie Subject: [PATCH] drm/drm_pci.c: Use dma_zalloc_coherent Message-ID: <20181023040222.GA1540@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: Tue, 23 Oct 2018 07:02:39 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: brajeswar.linux@gmail.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, sabyasachi.linux@gmail.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Replace dma_alloc_coherent + memset with dma_zalloc_coherent. Signed-off-by: Souptick Joarder --- drivers/gpu/drm/drm_pci.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/drm_pci.c b/drivers/gpu/drm/drm_pci.c index 896e42a..1427879 100644 --- a/drivers/gpu/drm/drm_pci.c +++ b/drivers/gpu/drm/drm_pci.c @@ -61,15 +61,14 @@ drm_dma_handle_t *drm_pci_alloc(struct drm_device * dev, size_t size, size_t ali return NULL; dmah->size = size; - dmah->vaddr = dma_alloc_coherent(&dev->pdev->dev, size, &dmah->busaddr, GFP_KERNEL | __GFP_COMP); + dmah->vaddr = dma_zalloc_coherent(&dev->pdev->dev, size, &dmah->busaddr, + GFP_KERNEL | __GFP_COMP); if (dmah->vaddr == NULL) { kfree(dmah); return NULL; } - memset(dmah->vaddr, 0, size); - /* XXX - Is virt_to_page() legal for consistent mem? */ /* Reserve */ for (addr = (unsigned long)dmah->vaddr, sz = size;