Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp6850936ybi; Mon, 22 Jul 2019 02:48:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqyPPLs0XGLj1/u/PTNoejk+Oyphe8ocYNHs5MWOhlyx4t7r/t2j/RByE4ePSdDnhc8qjYgY X-Received: by 2002:a63:1765:: with SMTP id 37mr1698335pgx.447.1563788903901; Mon, 22 Jul 2019 02:48:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563788903; cv=none; d=google.com; s=arc-20160816; b=puobpLc19dvkDlo7dNOXbzlTPaXe63OaQt3b9+jn9ShVV0Al/dzgPuQyQwwnFzSMsp mBmH/unbIJ/VmZmrDBwBWvMP1qx4CC3BGmXfb0kD2MHyBXeNDSsnrHNP7aeMip/5vDzW 1c7aGLbfWe+jvZ/si82FGvJOeiLvrGV9nilJtPJiW50gx2atQOqj8F8eUyONqiZ30CpW 5Jko47sH3PlcvXe/IVWWnWztdEhXFNlFVUByzCZ9pp5JiEN0IeEc5wLSvHvfectPOssS AWn0twTJcERLYNIRpLarwt7sgjVFZfrhnTct5noPm4dQevEBrEPAUwaEofsnqEssrbhT 0irA== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=hqFR/L+uhLTSs16aNxePagmRy/A7My1xi31i8lIW/rQ=; b=uXb0L+CR+mgw6WOWZDdldy4GH1ZIa8cNnyIlJPkfpyhXcr9EEfPEIg5/5JwKjYTUZD O9aF6zJC+lnNhaZdDdR7eG9SXOPmuagSWCf/3qLCSOpPbkWs0hEOOXgvpaQ0EsoaelYq Ybx9j0rlzGHp6GK/D9fQF/eZTutUR/SLiVi5LIW9CcF9L9PIIj0HZv4r9ePbTNY2l3LE NXQG4W4WZ+8JF1s1TVD/6pHu9QwgXy6fWNliYob8d3oQSw/6UUJW6986Z1ntDiIF06UP fX8WRvejRlKpJwfI8LuevsNwG4qYC8s/NGcBBguHvhFqsDDVt22p7vOLY4YRzKfG1Qsv /SFQ== 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 a7si11591050pfc.54.2019.07.22.02.48.08; Mon, 22 Jul 2019 02:48:23 -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 S1728999AbfGVJbF (ORCPT + 99 others); Mon, 22 Jul 2019 05:31:05 -0400 Received: from verein.lst.de ([213.95.11.211]:58727 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728991AbfGVJbD (ORCPT ); Mon, 22 Jul 2019 05:31:03 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 2FC9B68BFE; Mon, 22 Jul 2019 11:31:00 +0200 (CEST) Date: Mon, 22 Jul 2019 11:30:59 +0200 From: Christoph Hellwig To: Marc Gonzalez Cc: Minwoo Im , MSM , LKML , Andy Gross , Bjorn Andersson , Stanimir Varbanov , Rob Clark , Stephen Boyd , Christoph Hellwig Subject: Re: [PATCH] firmware: qcom_scm: fix error for incompatible pointer Message-ID: <20190722093059.GA29538@lst.de> References: <20190719134303.7617-1-minwoo.im.dev@gmail.com> <7ea51e42-ab8a-e4e2-1833-651e2dabca3c@free.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <7ea51e42-ab8a-e4e2-1833-651e2dabca3c@free.fr> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 22, 2019 at 10:38:55AM +0200, Marc Gonzalez wrote: > > In file included from drivers/firmware/qcom_scm.c:12:0: > > ./include/linux/dma-mapping.h:636:21: note: expected ‘dma_addr_t * {aka long long unsigned int *}’ but argument is of type ‘phys_addr_t * {aka unsigned int *}’ > > static inline void *dma_alloc_coherent(struct device *dev, size_t size, > > ^~~~~~~~~~~~~~~~~~ > > ``` > > > > We just can cast phys_addr_t to dma_addr_t here. > > IME, casting is rarely a proper solution. *nod* ptr_phys probably should be a dma_addr_t. Unless this driver is so magic that it really wants a physical and not a dma address, in which case it needs to use alloc_pages instead of dma_alloc_coherent and then call page_to_phys on the returned page, and a very big comment explaining why it is so special.