dmaengine: fsl-edma: fix spare build warning
authorFrank Li <Frank.Li@nxp.com>
Thu, 21 Dec 2023 15:35:24 +0000 (10:35 -0500)
committerVinod Koul <vkoul@kernel.org>
Wed, 7 Feb 2024 08:40:17 +0000 (09:40 +0100)
../drivers/dma/fsl-edma-common.c:93:9: sparse: warning: cast removes address space '__iomem' of expression
../drivers/dma/fsl-edma-common.c:101:25: sparse: warning: cast removes address space '__iomem' of expression
...
../drivers/dma/fsl-edma-main.c:557:17: sparse:    got restricted __le32 [usertype]

Signed-off-by: Frank Li <Frank.Li@nxp.com>
Link: https://lore.kernel.org/r/20231221153528.1588049-3-Frank.Li@nxp.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/fsl-edma-common.h
drivers/dma/fsl-edma-main.c

index ce779274d81e5ea0e402e73848cdab0d445e4364..fb45c7d4c1f4c9b830e5b75b63c1bd321469100c 100644 (file)
@@ -243,11 +243,13 @@ struct fsl_edma_engine {
 
 #define edma_readl_chreg(chan, __name)                         \
        edma_readl(chan->edma,                                  \
-                  (void __iomem *)&(container_of(chan->tcd, struct fsl_edma3_ch_reg, tcd)->__name))
+                  (void __iomem *)&(container_of(((__force void *)chan->tcd),\
+                                                 struct fsl_edma3_ch_reg, tcd)->__name))
 
 #define edma_writel_chreg(chan, val,  __name)                  \
        edma_writel(chan->edma, val,                            \
-                  (void __iomem *)&(container_of(chan->tcd, struct fsl_edma3_ch_reg, tcd)->__name))
+                  (void __iomem *)&(container_of(((__force void *)chan->tcd),\
+                                                 struct fsl_edma3_ch_reg, tcd)->__name))
 
 #define fsl_edma_get_tcd(_chan, _tcd, _field) ((_tcd)->_field)
 
index 45cc419b1b4acbe87c12c3daaccafce73f8de1ba..df3af5762adcff4da3949b4515f76e9c2714e339 100644 (file)
@@ -536,7 +536,7 @@ static int fsl_edma_probe(struct platform_device *pdev)
                fsl_chan->pdev = pdev;
                vchan_init(&fsl_chan->vchan, &fsl_edma->dma_dev);
 
-               edma_write_tcdreg(fsl_chan, 0, csr);
+               edma_write_tcdreg(fsl_chan, cpu_to_le32(0), csr);
                fsl_edma_chan_mux(fsl_chan, 0, false);
        }