From patchwork Wed Sep 5 07:38:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ding Xiang X-Patchwork-Id: 10588369 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 3FE321669 for ; Wed, 5 Sep 2018 07:48:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AFC0128E77 for ; Wed, 5 Sep 2018 07:48:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A36D028EEA; Wed, 5 Sep 2018 07:48:00 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1337828E77 for ; Wed, 5 Sep 2018 07:48:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727635AbeIEMQz (ORCPT ); Wed, 5 Sep 2018 08:16:55 -0400 Received: from cmccmta1.chinamobile.com ([221.176.66.79]:27933 "EHLO cmccmta1.chinamobile.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727628AbeIEMQz (ORCPT ); Wed, 5 Sep 2018 08:16:55 -0400 X-Greylist: delayed 548 seconds by postgrey-1.27 at vger.kernel.org; Wed, 05 Sep 2018 08:16:53 EDT Received: from spf.mail.chinamobile.com (unknown[172.16.121.5]) by rmmx-syy-dmz-app03-12003 (RichMail) with SMTP id 2ee35b8f8809a51-e6a7c; Wed, 05 Sep 2018 15:38:49 +0800 (CST) X-RM-TRANSID: 2ee35b8f8809a51-e6a7c X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 Received: from localhost.localdomain (unknown[223.105.0.243]) by rmsmtp-syy-appsvr03-12003 (RichMail) with SMTP id 2ee35b8f8808c8f-94826; Wed, 05 Sep 2018 15:38:49 +0800 (CST) X-RM-TRANSID: 2ee35b8f8808c8f-94826 From: Ding Xiang To: ysato@users.sourceforge.jp, dalias@libc.org, linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org Cc: dingxiang@cmss.chinamobile.com Subject: [PATCH] arch: sh: Replace dma_alloc_coherent/memset with dma_zalloc_coherent Date: Wed, 5 Sep 2018 15:38:46 +0800 Message-Id: <1536133126-21017-1-git-send-email-dingxiang@cmss.chinamobile.com> X-Mailer: git-send-email 1.9.1 Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP use dma_zalloc_coherent instead of dma_alloc_coherent/memset Signed-off-by: Ding Xiang --- arch/sh/mm/consistent.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/sh/mm/consistent.c b/arch/sh/mm/consistent.c index 792f361..aa4e450 100644 --- a/arch/sh/mm/consistent.c +++ b/arch/sh/mm/consistent.c @@ -52,14 +52,12 @@ int __init platform_resource_setup_memory(struct platform_device *pdev, if (!memsize) return 0; - buf = dma_alloc_coherent(&pdev->dev, memsize, &dma_handle, GFP_KERNEL); + buf = dma_zalloc_coherent(&pdev->dev, memsize, &dma_handle, GFP_KERNEL); if (!buf) { pr_warning("%s: unable to allocate memory\n", name); return -ENOMEM; } - memset(buf, 0, memsize); - r->flags = IORESOURCE_MEM; r->start = dma_handle; r->end = r->start + memsize - 1;