Skip to contentSkip to conversation

driver: dwmmc: Fix pointer conversion warnings for hikey

PATCH New Prabhakar Kushwaha 2 participants 2 messages Oct 25, 2015 – Nov 13, 2015 MMC, SD and SDIO

lore
Share & tools
lore
#0 lore raw

PATCH 2/5 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;

---
 drivers/mmc/dw_mmc.c        | 6 +++---
 drivers/mmc/hi6220_dw_mmc.c | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/mmc/dw_mmc.c +3 -3
index 26d34ae..4375abc 100644
@@ -40,7 +40,7 @@ static void dwmci_set_idma_desc(struct dwmci_idmac *idmac,
 	desc->flags = desc0;
 	desc->cnt = desc1;
 	desc->addr = desc2;
-	desc->next_addr = (unsigned int)desc + sizeof(struct dwmci_idmac);
+	desc->next_addr = (ulong)desc + sizeof(struct dwmci_idmac);
 }
 
 static void dwmci_prepare_data(struct dwmci_host *host,
@@ -58,7 +58,7 @@ static void dwmci_prepare_data(struct dwmci_host *host,
 	dwmci_wait_reset(host, DWMCI_CTRL_FIFO_RESET);
 
 	data_start = (ulong)cur_idmac;
-	dwmci_writel(host, DWMCI_DBADDR, (unsigned int)cur_idmac);
+	dwmci_writel(host, DWMCI_DBADDR, (ulong)cur_idmac);
 
 	do {
 		flags = DWMCI_IDMAC_OWN | DWMCI_IDMAC_CH ;
@@ -70,7 +70,7 @@ static void dwmci_prepare_data(struct dwmci_host *host,
 			cnt = data->blocksize * 8;
 
 		dwmci_set_idma_desc(cur_idmac, flags, cnt,
-				    (u32)bounce_buffer + (i * PAGE_SIZE));
+				    (ulong)bounce_buffer + (i * PAGE_SIZE));
 
 		if (blk_cnt <= 8)
 			break;
drivers/mmc/hi6220_dw_mmc.c +1 -1
index 731458c..b0d063c 100644
@@ -48,7 +48,7 @@ int hi6220_dwmci_add_port(int index, u32 regbase, int bus_width)
 		return -ENOMEM;
 	}
 
-	host->ioaddr = (void *)regbase;
+	host->ioaddr = (void *)(ulong)regbase;
 	host->buswidth = bus_width;
 	host->bus_hz = MMC0_DEFAULT_FREQ;
 
Signature · 1 line
1.9.1
#1 lore raw

PATCH 2/5 driver: dwmmc: Fix pointer conversion warnings for hikey

Quoted 16 lines · Prabhakar Kushwaha

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));
         ^
Quoted 7 lines

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;

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151112/2d08be2d/attachment.sig>