• Arnd Bergmann's avatar
    mmc: sunxi: avoid invalid pointer calculation · d34712d2
    Arnd Bergmann authored
    The sunxi mmc driver tries to calculate a dma address by using pointer
    arithmetic, which causes a warning when dma_addr_t is wider than a pointer:
    
    drivers/mmc/host/sunxi-mmc.c: In function 'sunxi_mmc_init_idma_des':
    drivers/mmc/host/sunxi-mmc.c:296:35: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
      struct sunxi_idma_des *pdes_pa = (struct sunxi_idma_des *)host->sg_dma;
                                       ^
    
    To avoid this warning and to simplify the logic, this changes
    the code to avoid the cast and calculate the correct address
    manually. The behavior should be unchanged.
    Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
    Acked-by: default avatarDavid Lanzendörfer <david.lanzendoerfer@o2s.ch>
    Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
    d34712d2
sunxi-mmc.c 29.4 KB