Skip to contentSkip to conversation

dmaengine: mcf-edma: avoid warning for wrong pointer cast

PATCH New Angelo Dureghello 1 participant 1 message Sep 14, 2018 dmaengine

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 dmaengine: mcf-edma: avoid warning for wrong pointer cast

This patch fixes the following compilation warning reported during x86_64 allmodconfig build:

drivers/dma/mcf-edma.c: In function 'mcf_edma_filter_fn':
drivers/dma/mcf-edma.c:296:33: warning: cast from pointer to
integer of different size [-Wpointer-to-int-cast]

        return (mcf_chan->slave_id == (u32)param);

---
Changes for v2:
- added Reported-By

Changes for v3:
- added more details about the patch
- changed channel request cast using uintptr_t

---
 drivers/dma/mcf-edma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/dma/mcf-edma.c +1 -1
index 4d30d5302649..5de1b07eddff 100644
@@ -293,7 +293,7 @@ bool mcf_edma_filter_fn(struct dma_chan *chan, void *param)
 	if (chan->device->dev->driver == &mcf_edma_driver.driver) {
 		struct fsl_edma_chan *mcf_chan = to_fsl_edma_chan(chan);
 
-		return (mcf_chan->slave_id == (u32)param);
+		return (mcf_chan->slave_id == (uintptr_t)param);
 	}
 
 	return false;