From patchwork Tue Apr 7 09:09:01 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rameshwar Prasad Sahu X-Patchwork-Id: 6168271 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 31AB7BF4A6 for ; Tue, 7 Apr 2015 09:18:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 45DC7201ED for ; Tue, 7 Apr 2015 09:18:28 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4F96C201D3 for ; Tue, 7 Apr 2015 09:18:27 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YfPYu-000325-6M; Tue, 07 Apr 2015 09:12:48 +0000 Received: from casper.infradead.org ([2001:770:15f::2]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YfPWZ-0001Ez-Kw for linux-arm-kernel@bombadil.infradead.org; Tue, 07 Apr 2015 09:10:23 +0000 Received: from [192.195.68.30] (helo=denmail01.apm.com) by casper.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YfPWT-0000Va-TH for linux-arm-kernel@lists.infradead.org; Tue, 07 Apr 2015 09:10:19 +0000 Received: from apm.com (pnqlwv041.amcc.com [10.48.19.141]) by denmail01.apm.com (8.13.8/8.13.8) with ESMTP id t3799H1V015008; Tue, 7 Apr 2015 03:09:18 -0600 Received: (from rsahu@localhost) by apm.com (8.13.8/8.13.8/Submit) id t37994xu001898; Tue, 7 Apr 2015 14:39:04 +0530 From: Rameshwar Prasad Sahu To: vinod.koul@intel.com, dan.j.williams@intel.com Subject: [PATCH] dmaengine: xgene-dma: Fix sparse wannings incorrect type in assignment (different base types) Date: Tue, 7 Apr 2015 14:39:01 +0530 Message-Id: <1428397741-1837-1-git-send-email-rsahu@apm.com> X-Mailer: git-send-email 1.8.2.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150407_101018_188654_EAE9B57C X-CRM114-Status: GOOD ( 11.59 ) X-Spam-Score: -0.4 (/) Cc: devicetree@vger.kernel.org, arnd@arndb.de, jcm@redhat.com, Rameshwar Prasad Sahu , patches@apm.com, linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch fixes compilation sparse warnings like incorrect type in assignment (different base types), cast to restricted __le64, symbol '__UNIQUE_ID_author__COUNTER__' has multiple initializers etc. This patch is based on slave-dma / for-linus branch. (commit: 9f2fd0dfa594d857fbdaeda523ff7a46f16567f5 [26/28] dmaengine: Add support for APM X-Gene SoC DMA engine driver) Reported-by: kbuild test robot Signed-off-by: Rameshwar Prasad Sahu --- drivers/dma/xgene-dma.c | 43 +++++++++++++++++++++---------------------- 1 file changed, 21 insertions(+), 22 deletions(-) -- 1.8.2.1 diff --git a/drivers/dma/xgene-dma.c b/drivers/dma/xgene-dma.c index aa61935..a89287f 100755 --- a/drivers/dma/xgene-dma.c +++ b/drivers/dma/xgene-dma.c @@ -238,10 +238,10 @@ dev_err(chan->dev, "%s: " fmt, chan->name, ##arg) struct xgene_dma_desc_hw { - u64 m0; - u64 m1; - u64 m2; - u64 m3; + __le64 m0; + __le64 m1; + __le64 m2; + __le64 m3; }; enum xgene_dma_ring_cfgsize { @@ -388,12 +388,12 @@ static bool is_pq_enabled(struct xgene_dma *pdma) return !(val & XGENE_DMA_PQ_DISABLE_MASK); } -static void xgene_dma_cpu_to_le64(u64 *desc, int count) +static void xgene_dma_cpu_to_le64(struct xgene_dma_desc_hw *desc) { - int i; - - for (i = 0; i < count; i++) - desc[i] = cpu_to_le64(desc[i]); + desc->m0 = cpu_to_le64(((u64 *)desc)[0]); + desc->m1 = cpu_to_le64(((u64 *)desc)[1]); + desc->m2 = cpu_to_le64(((u64 *)desc)[2]); + desc->m3 = cpu_to_le64(((u64 *)desc)[3]); } static u16 xgene_dma_encode_len(u32 len) @@ -499,9 +499,9 @@ static void xgene_dma_prep_cpy_desc(struct xgene_dma_chan *chan, skip_additional_src: /* Hardware stores descriptor in little endian format */ - xgene_dma_cpu_to_le64(desc1, 4); + xgene_dma_cpu_to_le64(desc1); if (desc2) - xgene_dma_cpu_to_le64(desc2, 4); + xgene_dma_cpu_to_le64(desc2); } static void xgene_dma_prep_xor_desc(struct xgene_dma_chan *chan, @@ -540,8 +540,8 @@ static void xgene_dma_prep_xor_desc(struct xgene_dma_chan *chan, } /* Hardware stores descriptor in little endian format */ - xgene_dma_cpu_to_le64(desc1, 4); - xgene_dma_cpu_to_le64(desc2, 4); + xgene_dma_cpu_to_le64(desc1); + xgene_dma_cpu_to_le64(desc2); /* Update meta data */ *nbytes = len; @@ -1895,9 +1895,9 @@ static int xgene_dma_get_resources(struct platform_device *pdev, pdma->csr_dma = devm_ioremap(&pdev->dev, res->start, resource_size(res)); - if (IS_ERR(pdma->csr_dma)) { + if (!pdma->csr_dma) { dev_err(&pdev->dev, "Failed to ioremap csr region"); - return PTR_ERR(pdma->csr_dma); + return -ENOMEM; } /* Get DMA ring csr region */ @@ -1909,9 +1909,9 @@ static int xgene_dma_get_resources(struct platform_device *pdev, pdma->csr_ring = devm_ioremap(&pdev->dev, res->start, resource_size(res)); - if (IS_ERR(pdma->csr_ring)) { + if (!pdma->csr_ring) { dev_err(&pdev->dev, "Failed to ioremap ring csr region"); - return PTR_ERR(pdma->csr_ring); + return -ENOMEM; } /* Get DMA ring cmd csr region */ @@ -1923,9 +1923,9 @@ static int xgene_dma_get_resources(struct platform_device *pdev, pdma->csr_ring_cmd = devm_ioremap(&pdev->dev, res->start, resource_size(res)); - if (IS_ERR(pdma->csr_ring_cmd)) { + if (!pdma->csr_ring_cmd) { dev_err(&pdev->dev, "Failed to ioremap ring cmd csr region"); - return PTR_ERR(pdma->csr_ring_cmd); + return -ENOMEM; } /* Get efuse csr region */ @@ -1937,9 +1937,9 @@ static int xgene_dma_get_resources(struct platform_device *pdev, pdma->csr_efuse = devm_ioremap(&pdev->dev, res->start, resource_size(res)); - if (IS_ERR(pdma->csr_efuse)) { + if (!pdma->csr_efuse) { dev_err(&pdev->dev, "Failed to ioremap efuse csr region"); - return PTR_ERR(pdma->csr_efuse); + return -ENOMEM; } /* Get DMA error interrupt */ @@ -2085,6 +2085,5 @@ module_platform_driver(xgene_dma_driver); MODULE_DESCRIPTION("APM X-Gene SoC DMA driver"); MODULE_AUTHOR("Rameshwar Prasad Sahu "); -MODULE_AUTHOR("Loc Ho "); MODULE_LICENSE("GPL"); MODULE_VERSION("1.0");