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: 123115 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp8815615qgn; Tue, 2 Jan 2018 02:49:22 -0800 (PST) X-Google-Smtp-Source: ACJfBouTj8M1zPeg9I3w1E6T06gIh87GuOsr2SBhC3FnVIuceN9Ok67OVuy1Z8/bxH5wbmpRecEh X-Received: by 10.99.117.93 with SMTP id f29mr39401833pgn.264.1514890162822; Tue, 02 Jan 2018 02:49:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1514890162; cv=none; d=google.com; s=arc-20160816; b=tW/WpeTn41tNXArBDc4R4E+yw0mLO0Fim6f9ftJJo4Enolb/mU+IbAoDfSknpNAEFC HDrhuC++WxD/YzLByBsWIXpkBxC5ZdHKeOn1+fT2555XVwokHFXudbSJA5G+D/55r0h3 ptOKZYBQTmyjs8hGYkvJy5NXDg5q87RMLktQ1y+LLL/MNPxTEtBu35GVUOdbVnNVpX5X /E+N6OGNWbqHPORSRJuKTCfJiUYB5bc3FtSzZ1HeR1HOFPRwRWl9cIn+Z2gS4Bc0HeMu 90C3PGeZ431WPo+c2u/fevw/d3bbJ2ngIQs3xAqeMS+S1cA5nGB9itk7uH7RjtgaBFlz D0aA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=fLe1KDWRZ04IWQE5laGsSCN60V1otuibsfE3Z4PFlws=; b=GHiW9gYw9lltpMtJQdRn8M9X5n0yotHpf1XIhGhXYIlZKShb5ZixuQuULVNYIIVZJo rKdqvB9zz/a35JTX777iC3WltXL2/f0sj+gqRrmEJ2gz2UbMvEfbxbGoHQxXtCtA8/1p PJFc8ggt/HWph4jXor7fvsk26DJ4g366mfGszOSnYpzhv/Jf87pSYoX8HceGVKPrlLyh yPb1hkp4JW1lI/nxDijLgzJbVLm1y76b3jt526OMwR03XNBfEDIXxrC90hGLiNgO+CQO E6BQ4dmbqqA2uD/V5e+OLVITwIHKjr43GKloRaHefo3XqARQK558GzUwxOYPo66XU25o ddiQ== 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 v22si20862251pgc.724.2018.01.02.02.49.22; Tue, 02 Jan 2018 02:49:22 -0800 (PST) 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 S1752484AbeABKtS (ORCPT + 28 others); Tue, 2 Jan 2018 05:49:18 -0500 Received: from mout.kundenserver.de ([212.227.126.187]:51148 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750736AbeABKtQ (ORCPT ); Tue, 2 Jan 2018 05:49:16 -0500 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 Cc: Arnd Bergmann , Greg Kroah-Hartman , Sagar Dharia , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: [PATCH] slimbus: qcom-ctrl: use normal allocation Date: Tue, 2 Jan 2018 11:48:54 +0100 Message-Id: <20180102104909.1369737-1-arnd@arndb.de> X-Mail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ERvw== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 2.9.0 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;