From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AFA4CC433EF for ; Mon, 20 Jun 2022 06:01:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232762AbiFTGBe (ORCPT ); Mon, 20 Jun 2022 02:01:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37520 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238471AbiFTGBc (ORCPT ); Mon, 20 Jun 2022 02:01:32 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2009EDFD8; Sun, 19 Jun 2022 23:01:32 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id 90D1A68D06; Mon, 20 Jun 2022 08:01:28 +0200 (CEST) Date: Mon, 20 Jun 2022 08:01:27 +0200 From: Christoph Hellwig To: Heiko Stuebner Cc: palmer@dabbelt.com, paul.walmsley@sifive.com, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, wefu@redhat.com, guoren@kernel.org, cmuellner@linux.com, philipp.tomsich@vrull.eu, hch@lst.de, samuel@sholland.org, atishp@atishpatra.org, anup@brainfault.org, mick@ics.forth.gr, robh+dt@kernel.org, krzk+dt@kernel.org, devicetree@vger.kernel.org, drew@beagleboard.org, rdunlap@infradead.org Subject: Re: [PATCH 1/4] of: also handle dma-noncoherent in of_dma_is_coherent() Message-ID: <20220620060127.GA10297@lst.de> References: <20220619203212.3604485-1-heiko@sntech.de> <20220619203212.3604485-2-heiko@sntech.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220619203212.3604485-2-heiko@sntech.de> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On Sun, Jun 19, 2022 at 10:32:09PM +0200, Heiko Stuebner wrote: > bool of_dma_is_coherent(struct device_node *np) > { > struct device_node *node; > + bool ret = false; I'd rename this to coherent or is_coherent. > > if (IS_ENABLED(CONFIG_OF_DMA_DEFAULT_COHERENT)) > - return true; > + ret = true; And then do this at initialization time: bool is_coherent = IS_ENABLED(CONFIG_OF_DMA_DEFAULT_COHERENT); but otherwise this looks good to me.