Commit 41f7be3c78e793535e484e5f5010cc98410598de

Authored by Prabhakar Kushwaha
Committed by Tom Rini
1 parent 4e4ad6d140

driver: dwmmc: Fix pointer conversion warnings for hikey

Fix below compilation warings happening for hikey_defconfig

drivers/mmc/dw_mmc.c: In function ‘dwmci_set_idma_desc’:
drivers/mmc/dw_mmc.c:43:20: warning: cast from pointer to integer
of different size [-Wpointer-to-int-cast]
  desc->next_addr = (unsigned int)desc + sizeof(struct dwmci_idmac);
                    ^
drivers/mmc/dw_mmc.c: In function ‘dwmci_prepare_data’:
drivers/mmc/dw_mmc.c:61:35: warning: cast from pointer to integer
of different size [-Wpointer-to-int-cast]
  dwmci_writel(host, DWMCI_DBADDR, (unsigned int)cur_idmac);
                                   ^
drivers/mmc/dw_mmc.c:73:9: warning: cast from pointer to integer
of different size [-Wpointer-to-int-cast]
         (u32)bounce_buffer + (i * PAGE_SIZE));
         ^
  CC      drivers/mmc/hi6220_dw_mmc.o
drivers/mmc/hi6220_dw_mmc.c: In function ‘hi6220_dwmci_add_port’:
drivers/mmc/hi6220_dw_mmc.c:51:17: warning: cast to pointer from integer
of different size [-Wint-to-pointer-cast]
  host->ioaddr = (void *)regbase;

Signed-off-by: Prabhakar Kushwaha <prabhakar@freescale.com>

Showing 2 changed files with 4 additions and 4 deletions Side-by-side Diff

drivers/mmc/dw_mmc.c
... ... @@ -40,7 +40,7 @@
40 40 desc->flags = desc0;
41 41 desc->cnt = desc1;
42 42 desc->addr = desc2;
43   - desc->next_addr = (unsigned int)desc + sizeof(struct dwmci_idmac);
  43 + desc->next_addr = (ulong)desc + sizeof(struct dwmci_idmac);
44 44 }
45 45  
46 46 static void dwmci_prepare_data(struct dwmci_host *host,
... ... @@ -58,7 +58,7 @@
58 58 dwmci_wait_reset(host, DWMCI_CTRL_FIFO_RESET);
59 59  
60 60 data_start = (ulong)cur_idmac;
61   - dwmci_writel(host, DWMCI_DBADDR, (unsigned int)cur_idmac);
  61 + dwmci_writel(host, DWMCI_DBADDR, (ulong)cur_idmac);
62 62  
63 63 do {
64 64 flags = DWMCI_IDMAC_OWN | DWMCI_IDMAC_CH ;
... ... @@ -70,7 +70,7 @@
70 70 cnt = data->blocksize * 8;
71 71  
72 72 dwmci_set_idma_desc(cur_idmac, flags, cnt,
73   - (u32)bounce_buffer + (i * PAGE_SIZE));
  73 + (ulong)bounce_buffer + (i * PAGE_SIZE));
74 74  
75 75 if (blk_cnt <= 8)
76 76 break;
drivers/mmc/hi6220_dw_mmc.c
... ... @@ -48,7 +48,7 @@
48 48 return -ENOMEM;
49 49 }
50 50  
51   - host->ioaddr = (void *)regbase;
  51 + host->ioaddr = (void *)(ulong)regbase;
52 52 host->buswidth = bus_width;
53 53 host->bus_hz = MMC0_DEFAULT_FREQ;
54 54