Received: by 10.213.65.68 with SMTP id h4csp1099848imn; Wed, 21 Mar 2018 02:36:42 -0700 (PDT) X-Google-Smtp-Source: AG47ELuKw/FuRC8bI0hu4YgNIG4UgJ0Wh1ScEy9ZkaL1tF8kq8MuK5ESGZPqLzyGtwt+8Ri3iY+u X-Received: by 10.101.97.15 with SMTP id z15mr12559023pgu.393.1521625002506; Wed, 21 Mar 2018 02:36:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521625002; cv=none; d=google.com; s=arc-20160816; b=vWPTyisxL17l6wRAYX+fgcxIzRRyAKeeVusZAJpck3RPxd2LjcM2mZ5UCjZmBvppXO LbBv2xTx7St6h4yW6uRDYiaOUqBn0og3ZTCjhTyMQdONnj1qyqz3qx2C/QX74s/s17YP +ESIr2bbU+khyd6+Jo/k0+sMkFJ/QVBK3eF1SUzuFqPaS+XEXTgRuazK/GbOFrxkRWIZ IhdtOIg7zgvuaKBbI8adXg/99P9/lzGZMpSFTOG3pucHSuHdbCISsJMijeMok1jHKzWl T3s1VnM0XsNAknBjnZt85hv+k9kzaAHXF1CN7jdw9p9td0M8sHgEOiSCWLYDNQZ8FdkG bdnA== 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:arc-authentication-results; bh=hsnRAPQw8uVkSeYb2aa33uOb/52f7aF0y2jP+/l9z+Y=; b=SoKDSEzQFUpcAdlJfFWRUeDbN201RmeQoeRgNtcUCkuHwJDC11ueUrPx8G60Bfg62i PVJ6myCr/bLBInIHl+3JCTXJbRd2JsBfENnvcQMRxuZrM+NGxfkDGHW1creowTdjWX6C Ai7EMYXNV7br5ukstAxWiUyRwVlu7RZOC5wqMCTeoDaOO74LCF2aenCHq47zXKdG713M CinkND2g2JRUcmJHcrsCLWE8NRxXG6EsOcHQIydIgvUGLY/dCi+jGgVPv66y+l/YvaUv 8h2Lf+Nc6gLRuZTjXLZWBed5T0Ck9ybUjnt3w05oXs5muRpdzzzH6VMjm//WH3RbWAEp +u7w== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k8si2761452pfi.3.2018.03.21.02.36.28; Wed, 21 Mar 2018 02:36: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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751805AbeCUJfc (ORCPT + 99 others); Wed, 21 Mar 2018 05:35:32 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:40632 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751455AbeCUJf2 (ORCPT ); Wed, 21 Mar 2018 05:35:28 -0400 Received: from localhost (unknown [37.171.182.147]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id DFE87E45; Wed, 21 Mar 2018 09:35:26 +0000 (UTC) Date: Wed, 21 Mar 2018 10:35:25 +0100 From: Greg KH To: Nipun Gupta Cc: robin.murphy@arm.com, hch@lst.de, linux@armlinux.org.uk, m.szyprowski@samsung.com, bhelgaas@google.com, zajec5@gmail.com, andy.gross@linaro.org, david.brown@linaro.org, dan.j.williams@intel.com, vinod.koul@intel.com, thierry.reding@gmail.com, robh+dt@kernel.org, frowand.list@gmail.com, jarkko.sakkinen@linux.intel.com, rafael.j.wysocki@intel.com, dmitry.torokhov@gmail.com, johan@kernel.org, msuchanek@suse.de, linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, linux-wireless@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, dmaengine@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-tegra@vger.kernel.org, devicetree@vger.kernel.org, linux-pci@vger.kernel.org, bharat.bhushan@nxp.com, leoyang.li@nxp.com Subject: Re: [PATCH v2 2/2] drivers: remove force dma flag from buses Message-ID: <20180321093525.GT14085@kroah.com> References: <1520868292-2479-1-git-send-email-nipun.gupta@nxp.com> <1521615323-4752-1-git-send-email-nipun.gupta@nxp.com> <1521615323-4752-2-git-send-email-nipun.gupta@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1521615323-4752-2-git-send-email-nipun.gupta@nxp.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 21, 2018 at 12:25:23PM +0530, Nipun Gupta wrote: > With each bus implementing its own DMA configuration callback, > there is no need for bus to explicitly have force_dma in its > global structure. This patch modifies of_dma_configure API to > accept an input parameter which specifies if implicit DMA > configuration is required even when it is not described by the > firmware. Having to "remember" what that bool variable means on the end of the function call is a royal pain over time, right? Why not just create a new function: dma_common_configure_force(dma) that always does this? Leave "dma_common_configure()" alone, and then wrap the old code with these two helper functions that call the 'core' code with the bool set properly? That way you do not have to "know" what that parameter is, the function name just documents it automatically, so when you see it in the bus-specific code, no need to go and have to hunt for anything. And if you are reading the dma core code, it's obvious what is happening as the functions are all right there. thanks, greg k-h