Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2343225imm; Thu, 23 Aug 2018 19:56:42 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdaz66R/TL2yX7Plkra3xTAEHYElZkE4G0mfO3OIC07Dp5N4//bPmkC1awzF1qK3k9Y3FK7A X-Received: by 2002:a62:4add:: with SMTP id c90-v6mr9372664pfj.65.1535079402535; Thu, 23 Aug 2018 19:56:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535079402; cv=none; d=google.com; s=arc-20160816; b=uH+OOlDoetgKrGr3KDTQ21YtpQiAVt0/Jyw7/n7H2xjCPP85U02jsABBhAJsyb+hR9 5kLm6+Fui0nuvpfnKpD9xZ7vvmmEh7jx4p2jMcVV4QCLaPscb/HMIjXZ9r5ckAgUrxfT yKVfPcgpGDIqvu4lOoRnL6jTmfpQJ8Bs9wyLPHn8CJsUPtQlAWQsZFBG7Ax4TC8ZCsRI 68UfHEEhShff2kijzgIdLOiiFYzOJp9cxA/qkJcADQGJG4ts/SwIt2mjWMruKe5kok9n PcE/QkbEYxKRvL5yq09MwMzzC7uIjIiYlME+H0E/aQBz+L8mN1Nmu+I4QFuTPpYnoaNW DAtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=VDXPSrMUP42HeNec/XJUXDP/5PhY8nR6dhYyntZXxRQ=; b=Ktd/QDOtT7TBmDNsrzpmWHqP1zt9reThqytNw+sokN+ZUgV3a2PQN2wPDS4czs/OKe xkrH7cYSGAO91NIowiB5hInGYM2of6NXvDsaDD8sFfye+KUGzvYY4JMgBQLV+5HlpCrs SveWCxQNxvUUU3RMjxfwgM1yBQKIUe1k7y1lgT7uEDeABjKJRWdx7UEsPKucFGC50U62 VCt6fsgpcmvZevHJYzYt1bD2IsnB02gQ3wOiNobLQoc712YShfBr10Fwatx0d4RNE+BW wsqLp/1sPxEfI+Ypnv72kYvvPmHLKjGQ9FsjzFtC2x/SEX39ZyJ+ly2rKw47JYiuhSjE Y/Sw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e12-v6si6667625pfd.38.2018.08.23.19.56.27; Thu, 23 Aug 2018 19:56:42 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726752AbeHXG15 (ORCPT + 99 others); Fri, 24 Aug 2018 02:27:57 -0400 Received: from mga09.intel.com ([134.134.136.24]:64509 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725735AbeHXG15 (ORCPT ); Fri, 24 Aug 2018 02:27:57 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Aug 2018 19:55:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,280,1531810800"; d="scan'208";a="65624766" Received: from ipu5-build.bj.intel.com (HELO [10.238.232.198]) ([10.238.232.198]) by fmsmga008.fm.intel.com with ESMTP; 23 Aug 2018 19:55:04 -0700 Subject: Re: [PATCH 1/2] media: ipu3-cio2: Use dma_zalloc_coherent to replace dma_alloc_coherent + memset To: zhong jiang , yong.zhi@intel.com, sakari.ailus@linux.intel.com, bingbu.cao@intel.com, mchehab@kernel.org, matthias.bgg@gmail.com Cc: tian.shu.qiu@intel.com, jian.xu.zheng@intel.com, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org References: <1534605415-11452-1-git-send-email-zhongjiang@huawei.com> <1534605415-11452-2-git-send-email-zhongjiang@huawei.com> From: Bing Bu Cao Message-ID: <541b8c22-018f-4df6-85d1-82a72d9ab669@linux.intel.com> Date: Fri, 24 Aug 2018 10:58:52 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <1534605415-11452-2-git-send-email-zhongjiang@huawei.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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! 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; > } >