Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2369246imm; Thu, 23 Aug 2018 20:38:36 -0700 (PDT) X-Google-Smtp-Source: AA+uWPzYHzIUmX2k0nheipgKCDBtxEcnKMDhGsTR8uaSOrtgP9eDh2KiTijARcuTTNSIwc5tKwNT X-Received: by 2002:a17:902:904c:: with SMTP id w12-v6mr61088775plz.95.1535081916021; Thu, 23 Aug 2018 20:38:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535081915; cv=none; d=google.com; s=arc-20160816; b=SXfGgWH1YaNcN0b+Mexk7ozl1mGvX3f+HtAoClEGQh3eK+zS81mkSa5nVpe9QRIP2R 4igNy5EOcQPzBGiC3vo4v6VjQiy4Pjnqa9HGsjFaYCj7QZRd819fA+E9bTQDEueYalOs r/XxTPCzcTkXfM/x9C5P04dR7+nx+qw3quR7qtuT5QnMexvN6acPQegIxpZfqvKs5C9K Dv70e8BsV38NqFKt5rMXqQCCHjiZbQtQKFhSHFpkvHomnUrSqUzqvHNNnfvNXyy4mvBp c3HEkthz0jyrhiomfKV8taAB3PUDADSoYygn3V4EVfddA2UpJu9e4SDw+poHx0qfkE90 FOEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :references:subject:cc:to:mime-version:user-agent:from:date :message-id:arc-authentication-results; bh=HHnvvkivlpOihg7Nm53xa9qnFveENOWd41D0jdzLpiM=; b=fcxDwtiOQR+L00OKjqJfe5JWWiEzZOX5NxZw1gj9JXH/eA3qUF04PbJdszgFwrIlpJ HNGNkhoEVEq2taMFa2UZpU/UFVSitD1SNDhyyhHyEFFU/B+4fmyxB6gqgPITCb/8/DbR ljdel6epjKcbHX8WIu3ldaKsRWptkHdxAfx5GvZJj+UzOn25YvI0d8d/EGA2RHZnHQub Qm8x6W5S8GOCXPm5dBuAkkkgaPTtELnuUn/lwIAYKs7VYersQ9GHTOSyiSmckab7w5wx ERtC7kuo18Stic7T7X7TH8I5GfSnwDJcvIO1urADcTLsKZJK+hKQElrP+sV+twIwdrqy Ibaw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w68-v6si6583325pfw.308.2018.08.23.20.38.20; Thu, 23 Aug 2018 20:38:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727462AbeHXHJ3 (ORCPT + 99 others); Fri, 24 Aug 2018 03:09:29 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:43484 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726085AbeHXHJ3 (ORCPT ); Fri, 24 Aug 2018 03:09:29 -0400 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 01D2B24E51B0; Fri, 24 Aug 2018 11:36:42 +0800 (CST) Received: from [127.0.0.1] (10.177.29.68) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.399.0; Fri, 24 Aug 2018 11:36:42 +0800 Message-ID: <5B7F7D49.10206@huawei.com> Date: Fri, 24 Aug 2018 11:36:41 +0800 From: zhong jiang User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: Bing Bu Cao CC: , , , , , , , , Subject: Re: [PATCH 1/2] media: ipu3-cio2: Use dma_zalloc_coherent to replace dma_alloc_coherent + memset References: <1534605415-11452-1-git-send-email-zhongjiang@huawei.com> <1534605415-11452-2-git-send-email-zhongjiang@huawei.com> <541b8c22-018f-4df6-85d1-82a72d9ab669@linux.intel.com> In-Reply-To: <541b8c22-018f-4df6-85d1-82a72d9ab669@linux.intel.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.29.68] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018/8/24 10:58, Bing Bu Cao wrote: > Hi, Jiang > > This looks fine for me in ipu3-cio2. > Actually, we already have this change locally, but I think we miss submit it to community. > Thanks! It's ok, Anyway, Thank you for let me know that. Best wishes, zhong jiang > On 08/18/2018 11:16 PM, zhong jiang wrote: >> dma_zalloc_coherent has implemented the dma_alloc_coherent() + memset(), >> We prefer to dma_zalloc_coherent instead of open-codeing. >> >> Signed-off-by: zhong jiang >> --- >> drivers/media/pci/intel/ipu3/ipu3-cio2.c | 6 ++---- >> 1 file changed, 2 insertions(+), 4 deletions(-) >> >> diff --git a/drivers/media/pci/intel/ipu3/ipu3-cio2.c b/drivers/media/pci/intel/ipu3/ipu3-cio2.c >> index 2902715..f0c6374 100644 >> --- a/drivers/media/pci/intel/ipu3/ipu3-cio2.c >> +++ b/drivers/media/pci/intel/ipu3/ipu3-cio2.c >> @@ -218,13 +218,11 @@ static int cio2_fbpt_init(struct cio2_device *cio2, struct cio2_queue *q) >> { >> struct device *dev = &cio2->pci_dev->dev; >> >> - q->fbpt = dma_alloc_coherent(dev, CIO2_FBPT_SIZE, &q->fbpt_bus_addr, >> - GFP_KERNEL); >> + q->fbpt = dma_zalloc_coherent(dev, CIO2_FBPT_SIZE, &q->fbpt_bus_addr, >> + GFP_KERNEL); >> if (!q->fbpt) >> return -ENOMEM; >> >> - memset(q->fbpt, 0, CIO2_FBPT_SIZE); >> - >> return 0; >> } >> > > . >