lkml.org 
[lkml]   [2015]   [May]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: Pointer Cast to Different Type Warnings in sh_mmcif.c
Date

Hi nick

Thank you for your feedback

> Greetings Ulf and others,
> I am getting the below build warnings on the latest version of Linus's tree:
> drivers/mmc/host/sh_mmcif.c: In function ‘sh_mmcif_request_dma_one’:
> drivers/mmc/host/sh_mmcif.c:401:4: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast ]
> (void *)pdata->slave_id_tx :
> ^
> drivers/mmc/host/sh_mmcif.c:402:4: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast
> (void *)pdata->slave_id_rx;
> After reading and tracing this issue it seems to be a cast for a u64 pointer to a unsigned in the following statement:
>
> if (pdata)
> slave_data = direction == DMA_MEM_TO_DEV ?
> (void *)pdata->slave_id_tx :
> (void *)pdata->slave_id_rx;
> I am wondering as the maintainer if this is a warning that doesn't need to re factor the structure definition for
> sh_mmcif_plat_data to use a u64 data type. Please let me known if I should consider re factoring the structure
> to clean up these warnings.

I guess this warning happen from
5f48dd0690cbcea3f35b9ef2f05d5468dedc80b0
(mmc: sh_mmcif: remove slave_id settings for DMAEngine)

I didn't check, but does cast issue is solved by this ?

- (void *)pdata->slave_id_tx :
- (void *)pdata->slave_id_rx;
+ (void *)(unsigned long)pdata->slave_id_tx :
+ (void *)(unsigned long)pdata->slave_id_rx;


Best regards
---
Kuninori Morimoto


\
 
 \ /
  Last update: 2015-05-11 06:01    [W:0.047 / U:33.456 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site