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 X-Spam-Level: X-Spam-Status: No, score=-2.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D314DC32792 for ; Mon, 30 Sep 2019 12:57:54 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A56D1215EA for ; Mon, 30 Sep 2019 12:57:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="fwbzHEP2" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A56D1215EA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Eqj7YmKXtrM3K6sG2z7dAe53B+ae7dII35PyT3MiFWk=; b=fwbzHEP2SNxlGc 5L1s5HyxDBSTUfwt6QeZ7OeZ5yVSW5y0MUvItH8RH1MMOl4bYB6Mr0OMzWxT/+qMjInO6VXEa6tSm yHhatuC45AByH5bZnvhFNLXS7aZ5v0e2FtQ/ckGZ0tUkzo1eVt9nKMxTtUhyVnYKvlp8X63qb7e4v cUTy/bZSHRouWEfAoJcfLPEvhj9GUJyM4Wj5MD7yxCuzWv3KuCGCqPKP2aCyI+I1Q5+DmYICtbztU I43kbvFNqTeyleSTOWwa04YAcc+xskeyl4nJyAYXmWiTj7aDM9fIgswjoh4Tix12m5uiKmuOBYKxP BFVYx8AekQDlCYX2b5wg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.2 #3 (Red Hat Linux)) id 1iEvFS-0007wF-A3; Mon, 30 Sep 2019 12:57:54 +0000 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 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-Disposition: inline In-Reply-To: <20190927002455.13169-6-robh@kernel.org> User-Agent: Mutt/1.12.1 (2019-06-15) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Florian Fainelli , Geert Uytterhoeven , Arnd Bergmann , linux-pci@vger.kernel.org, Nicolas Saenz Julienne , linux-kernel@vger.kernel.org, Marek Vasut , Lorenzo Pieralisi , Oza Pawandeep , Stefan Wahren , Simon Horman , Frank Rowand , linux-arm-kernel@lists.infradead.org, Robin Murphy Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.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; _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel