From patchwork Tue Jan 2 10:48:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 10140281 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3BC5860362 for ; Tue, 2 Jan 2018 10:49:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0208B28AA4 for ; Tue, 2 Jan 2018 10:49:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EAF2E28AC4; Tue, 2 Jan 2018 10:49:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 147E028AA4 for ; Tue, 2 Jan 2018 10:49:17 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 32BDE267381; Tue, 2 Jan 2018 11:49:16 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 2293E267386; Tue, 2 Jan 2018 11:49:14 +0100 (CET) Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.187]) by alsa0.perex.cz (Postfix) with ESMTP id 0A3F82668F0 for ; Tue, 2 Jan 2018 11:49:11 +0100 (CET) Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue005 [212.227.15.129]) with ESMTPA (Nemesis) id 0M0dvG-1emLsW24Ba-00urSj; Tue, 02 Jan 2018 11:49:10 +0100 From: Arnd Bergmann To: Srinivas Kandagatla Date: Tue, 2 Jan 2018 11:48:54 +0100 Message-Id: <20180102104909.1369737-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:LP/R00/FMSLt+NPnyCMLCDnYVkTu3MZsRSh9ACkD74HZ11bi6hE 2J8QNjVulZSfnwTqhInE1I2jcxdvoyt5f5jMTsyN4AV0/IGluYeEtVMaLmzy1YnUDujroDo cRyHxeOeAtOoBBomfPwdk0I3tJZUQopC0bfNL3R5uTbnAD0v+dcC7O/hWLwCHnMsx9gnMWl XDYP8peb/n4OhbnEHnplQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:9k0wpRHuVpo=:j7te4zqUHmKZaK8/byCvZK FDECEmJsOU47JtkW7+fyHktn8f2TW03u2l/sEngQHLVB98InoxaLPjqClUqNj4zIuH3vsn0nl Moh5LypkC7PCt7+PYBn+H0qRgS0mkgLCnA9axSkTeqw5LpxFMid0nPgpfI2REmEJ3pzcUbC9I RVTBB8XamTcieZ0nsJydKeAk+2Wex8kW7pbgKt0Td5SGh9gUcU6OKfT9pFBjzw93WFvUJKtym PoaEse9Xbg98nYUOJZSLc35ZCYBwl7Ag3t/oDbIPWp+MvIITfCtzveLBkJq6Pf5HJJ4BttRFZ JES9iQIX46QU6hNEPHHOtXl76rnbhc199/bm+YIS3TAOJjlf60EhGa+QKdxysTWD/vJoXvW// 1blroKu9QKMzruen8sTlVxG8HpKCHG2h4rsLXAPBalGzNHysjOOhQEAZ5t0f4mDkSJakdyPb2 mSTwzkvN7GAIIvUp5nEW7OW3c8jnsY9mCPMTtqUhLyF0zs9nuFqWlfsVtGOTH9EQxhIXVzfOv CO+eRceX3850sTozkzcHVK8/Heo+8OEdX3B0gRiix9C+j1/I45RI4RR4aTlbiWysdEHvLm4Yj eYeLV9QS1eFPI+VH3fcfQF2pvF8LI7c2u9+luzWlIt3t12faHcVwZ+JBN6ZkC+OeOJB7lrWkw LlU1oDndSnu7CA3Qygr/ZBnmuyOxBwKL8kkpxj5e1HqdPy0uyvIiG2hnsKY5z0yNg8R9r8F6i hbDp5xCoGgD/70A7ILlRHqoRcfb1E3+xwWERvw== Cc: Greg Kroah-Hartman , alsa-devel@alsa-project.org, Sagar Dharia , Arnd Bergmann , linux-kernel@vger.kernel.org Subject: [alsa-devel] [PATCH] slimbus: qcom-ctrl: use normal allocation X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP The previous patch addressed a warning but not the cause: drivers/slimbus/qcom-ctrl.c: In function 'qcom_slim_probe': drivers/slimbus/qcom-ctrl.c:584:9: error: passing argument 3 of 'dmam_alloc_coherent' from incompatible pointer type [-Werror=incompatible-pointer-types] There are two things wrong here: - The naming is very confusing, we now have a member named 'phys' that doesn't refer to a phys_addr_t but a dma_addr_t. If we needed a dma address, it should be named 'dma' to avoid confusion, and to make it less likely that someone passes it into a function that expects a physical address. - The dma address is not used at all at this point. It may have been designed to support DMA in the future, but today it doesn't, so the only effect right now is to make transfers artificially slower by using uncached memory instead of cached memory for a temporary buffer. This removes the unused structure member and instead changes the code to call devm_kcalloc(), which matches the usage of the 'base' pointer as an array of temporary buffers. Fixes: db809859c8ce ("slimbus: qcom: fix incompatible pointer warning") Signed-off-by: Arnd Bergmann --- drivers/slimbus/qcom-ctrl.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/slimbus/qcom-ctrl.c b/drivers/slimbus/qcom-ctrl.c index f51de1277912..fb1a5e0eb8dd 100644 --- a/drivers/slimbus/qcom-ctrl.c +++ b/drivers/slimbus/qcom-ctrl.c @@ -13,7 +13,6 @@ #include #include #include -#include #include #include "slimbus.h" @@ -93,7 +92,6 @@ struct slim_ctrl_buf { void *base; - dma_addr_t phy; spinlock_t lock; int head; int tail; @@ -579,17 +577,15 @@ static int qcom_slim_probe(struct platform_device *pdev) if (ret) goto err_rclk_enable_failed; - ctrl->tx.base = dmam_alloc_coherent(&pdev->dev, - (ctrl->tx.sl_sz * ctrl->tx.n), - &ctrl->tx.phy, GFP_KERNEL); + ctrl->tx.base = devm_kcalloc(&pdev->dev, ctrl->tx.n, ctrl->tx.sl_sz, + GFP_KERNEL); if (!ctrl->tx.base) { ret = -ENOMEM; goto err; } - ctrl->rx.base = dmam_alloc_coherent(&pdev->dev, - (ctrl->rx.sl_sz * ctrl->rx.n), - &ctrl->rx.phy, GFP_KERNEL); + ctrl->rx.base = devm_kcalloc(&pdev->dev,ctrl->rx.n, ctrl->rx.sl_sz, + GFP_KERNEL); if (!ctrl->rx.base) { ret = -ENOMEM; goto err;