Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752651AbdHINhI (ORCPT ); Wed, 9 Aug 2017 09:37:08 -0400 Received: from verein.lst.de ([213.95.11.211]:53496 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752338AbdHINhH (ORCPT ); Wed, 9 Aug 2017 09:37:07 -0400 Date: Wed, 9 Aug 2017 15:37:05 +0200 From: Christoph Hellwig To: Michael Moese Cc: Christoph Hellwig , Marek Szyprowski , Robin Murphy , linux-kernel@vger.kernel.org Subject: Re: [PATCH] Introduce dmam_zalloc_coherent() Message-ID: <20170809133705.GA25491@lst.de> References: <20170808091535.31371-1-michael.moese@men.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170808091535.31371-1-michael.moese@men.de> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 806 Lines: 15 On Tue, Aug 08, 2017 at 11:15:35AM +0200, Michael Moese wrote: > All memory allocation functions have a pendant for allocating zeroed > memory, but dmam_alloc_coherent does not have such a pendant. > However, it is easier to read dmam_zalloc_coherent than passing an extra > flag or, even worse, see memset() after the allocation. > This patch adds an inline function dmam_zalloc_coherent(), exactly like > the implementation of dma_zalloc_coherent(). I'm a bit worried about the __GFP_ZERO as we have lots of non-kmalloc implementations of these. But on the other hand we already implement dma_zalloc_coherent the same way, which means we'd already buggy. So I plan to apply this for 4.14, but I also plan to spend some time to implement all the existin alloc ops to make sure it's going to work fine.