Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp6919635ybn; Mon, 30 Sep 2019 06:01:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqw2nSzyN4FCmgm9JNWdOmSal8RtWcUghBNp1xpR48Tq96kJS5FLOd8vqdkWq+p6LOwUIOt2 X-Received: by 2002:adf:f008:: with SMTP id j8mr13052549wro.75.1569848512958; Mon, 30 Sep 2019 06:01:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569848512; cv=none; d=google.com; s=arc-20160816; b=P7InBN23Am0TQmYWTVq8HlJCSTPV019uPoQJgAf8oVWJYuSK7M54gTv6VWYN2iA3zX l5HcOwfCZXkyFJF/1n/P33IQCJVTgTT1uv7RzeZN4mll8hx6K6b7wTbM+rGCGMtEnj6p l3C26Ig5Oly/9vBH+mn2fTeB1OsPAZ7L0YQrSN5bUuHbb9IJw1ME6ob/2ZuEk0Wo0Zt0 OB+NhSKJbmwR7WOsZecARv4LabviBAAauN+XAZLsRB4RaciYcL+oyM48h12pRo2yb2Zy hqUv7UpkCZMXgz14TyZucfBrJW77Z9t3LjyBE+TsyCkYVhT6BiKa+BPaFH3Rf+KNxJMP Ee1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=fARuBLyTR4HXeEN5GAQcRLDiqW1FdAZoSRGfWrgXFl0=; b=fFxAP0a7xuGtk+hfuL6lpP0VuXjMbQzIYpBvVHOlUxEyMBxIY3osNeDptN87zyQ2Cv xHiKa7o45K759PEMgOfHYc67vEE2y3LC7iGd6GI+ylQrSZroh0x8OKJ4mVfAUgyk1TIp crerTL5hK6LHwsIVX7LePYCSkSNLdKC/WPWOF4T6MOQlzQTM+xBRZfL/JNAE+hSzpNI7 HdUvi5/Fqs+z7dGMU/D+Ap8gRQrtH5TB5wrKLNwRCREmV2VTW3iH2/hU9HARsmcN/AYa xJ0+5Bm4xMz4ztdLbL1h0HBot597s+rFvkndmPu5xchXCWG0fh8p/GzD3s3o8tjNDVKL P1MA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="Ytnu72k/"; 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 c12si7099791edb.394.2019.09.30.06.01.28; Mon, 30 Sep 2019 06:01:52 -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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="Ytnu72k/"; 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 S1731037AbfI3M5x (ORCPT + 99 others); Mon, 30 Sep 2019 08:57:53 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:55352 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731029AbfI3M5x (ORCPT ); Mon, 30 Sep 2019 08:57:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=fARuBLyTR4HXeEN5GAQcRLDiqW1FdAZoSRGfWrgXFl0=; b=Ytnu72k/V9UtQKPbqK+bXZ/rC hPlBEZtRwO5KMbdq53efq3EoWOWDdzlnAEzTmTzRPWZqNqS2scAwPoBpOsC5W4lQOBNLGgrEtyDzK ERPuqlt6nM23+LogLxjefgJzSg5jkTQYfNghQ4xb6+6GtOpewBVmCChuKzYFvaZBOgMfK6DeKrOmt CjVTmncnXQELuEjaCVwh29wZDCy9UYncMyV2MGsQMELqzsZp15ZlivvYbqb9uiJsP4/WJvis3Wo/U cI6ryWc4LilQ9scvbdS0zvXJYytusVy4xRSStne/M++GTrfPwI0h/YJdggMOkOgE8J0Imz17qiJnt fz0+Z45Ig==; Received: from hch by bombadil.infradead.org with local (Exim 4.92.2 #3 (Red Hat Linux)) id 1iEvFQ-0007vv-1U; Mon, 30 Sep 2019 12:57:52 +0000 Date: Mon, 30 Sep 2019 05:57:52 -0700 From: Christoph Hellwig To: Rob Herring Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Florian Fainelli , Arnd Bergmann , Frank Rowand , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Marek Vasut , Lorenzo Pieralisi , Oza Pawandeep , Stefan Wahren , Simon Horman , Geert Uytterhoeven , Robin Murphy , Nicolas Saenz Julienne Subject: Re: [PATCH 05/11] of: Ratify of_dma_configure() interface Message-ID: <20190930125752.GD12051@infradead.org> References: <20190927002455.13169-1-robh@kernel.org> <20190927002455.13169-6-robh@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190927002455.13169-6-robh@kernel.org> User-Agent: Mutt/1.12.1 (2019-06-15) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 26, 2019 at 07:24:49PM -0500, Rob Herring wrote: > -int of_dma_configure(struct device *dev, struct device_node *np, bool force_dma) > +int of_dma_configure(struct device *dev, struct device_node *parent, bool force_dma) This creates a > 80 char line. > { > u64 dma_addr, paddr, size = 0; > int ret; > bool coherent; > unsigned long offset; > const struct iommu_ops *iommu; > + struct device_node *np; > u64 mask; > > + np = dev->of_node; > + if (!np) > + np = parent; > + if (!np) > + return -ENODEV; I have to say I find the older calling convention simpler to understand. If we want to enforce the invariant I'd rather do that explicitly: if (dev->of_node && np != dev->of_node) return -EINVAL;