Skip to contentSkip to conversation

mmc:Add pointer cast to long for slave_id_rx and tx in the function, sh_mmcif_request_dma_one

PATCH Laurent Pinchart 1 participant 1 message May 11, 2015 1 message not in the archive MMC, SD and SDIO

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Hello,

Quoted 1 line · On Monday 11 May 2015 13:15:17 Nicholas Krause wrote:

This adds a pointer cast to long in the function, sh_mmif_request_dma_one

I would use the uintptr_t type instead of long, as it has been designed for this purpose exactly.

Quoted 3 lines

for the when assigning one of the variables slave_id_tx or slave_id_rx of the structure pointer,pdata to the void pointer, slave_data and the enum directon respectfully.

It's very nice to be respectful, but the commit message doesn't tell why this is needed. Something along the lines of "Cast integer to void * through uintptr_t to avoid compiler warning when compiling on 64bit platforms." would be more helpful.

Quoted 20 lines
---
 drivers/mmc/host/sh_mmcif.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mmc/host/sh_mmcif.c +2 -2
index 7eff087..e276558 100644
@@ -398,8 +398,8 @@ sh_mmcif_request_dma_one(struct sh_mmcif_host *host,
 
 	if (pdata)
 		slave_data = direction == DMA_MEM_TO_DEV ?
-			(void *)pdata->slave_id_tx :
-			(void *)pdata->slave_id_rx;
+			(void *)(long)pdata->slave_id_tx :
+			(void *)(long)pdata->slave_id_rx;
 
 	chan = dma_request_slave_channel_compat(mask, shdma_chan_filter,
 				slave_data, &host->pd->dev,
Signature · 3 lines
Regards,

Laurent Pinchart