Skip to contentSkip to conversation

mmc: bcm283x: fix int to pointer cast

PATCH New Seung-Woo Kim 3 participants 4 messages May 15, 2020 – May 18, 2020 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): CGME20200515101400epcas1p25d3d3ba611bde5628cba9cade6682c8f@epcas1p2.samsung.com

#1 lore raw

PATCH 1/1 mmc: bcm283x: fix int to pointer cast

On build with 32 bit, there is a warning for int-to-pointer-cast. Fix the int to pointer cast by using uintptr_t.

---
 drivers/mmc/bcm2835_sdhci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/bcm2835_sdhci.c +1 -1
index 39c93db275..c31f099f25 100644
@@ -209,7 +209,7 @@ static int bcm2835_sdhci_probe(struct udevice *dev)
 	priv->last_write = 0;
 
 	host->name = dev->name;
-	host->ioaddr = (void *)base;
+	host->ioaddr = (void *)(uintptr_t)base;
 	host->quirks = SDHCI_QUIRK_BROKEN_VOLTAGE | SDHCI_QUIRK_BROKEN_R1B |
 		SDHCI_QUIRK_WAIT_SEND_CMD | SDHCI_QUIRK_NO_HISPD_BIT;
 	host->max_clk = emmc_freq;
Signature · 1 line
2.19.2
#2 lore raw

PATCH 1/1 mmc: bcm283x: fix int to pointer cast

Quoted 2 lines · Seung-Woo Kim

On build with 32 bit, there is a warning for int-to-pointer-cast. Fix the int to pointer cast by using uintptr_t.

Could you share in more detail? I didn't see any warning with gcc 9.2 / 8.3 / 7.4 /6.5.

Best Regards,
Jaehoon Chung

Quoted 20 lines
---
 drivers/mmc/bcm2835_sdhci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/bcm2835_sdhci.c +1 -1
index 39c93db275..c31f099f25 100644
@@ -209,7 +209,7 @@ static int bcm2835_sdhci_probe(struct udevice *dev)
 	priv->last_write = 0;
 
 	host->name = dev->name;
-	host->ioaddr = (void *)base;
+	host->ioaddr = (void *)(uintptr_t)base;
 	host->quirks = SDHCI_QUIRK_BROKEN_VOLTAGE | SDHCI_QUIRK_BROKEN_R1B |
 		SDHCI_QUIRK_WAIT_SEND_CMD | SDHCI_QUIRK_NO_HISPD_BIT;
 	host->max_clk = emmc_freq;
#3 lore raw

PATCH 1/1 mmc: bcm283x: fix int to pointer cast

Hi Jaehoon,

Quoted 5 lines · Jaehoon Chung
Quoted 2 lines · Seung-Woo Kim

On build with 32 bit, there is a warning for int-to-pointer-cast. Fix the int to pointer cast by using uintptr_t.

Could you share in more detail? I didn't see any warning with gcc 9.2 / 8.3 / 7.4 /6.5.

Sorry for not giving detail. If I applied PICe XHCI support [1], and build rpi_4_32b, then I got related warning.

If [1] is not applied, then this can be ignored.

[1]
https://patchwork.ozlabs.org/project/uboot/patch/20200504124523.23484-7-s.nawrocki at samsung.com/

Best Regards,
- Seung-Woo Kim

Quoted 29 lines

Best Regards,
Jaehoon Chung

Quoted 20 lines
---
 drivers/mmc/bcm2835_sdhci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/bcm2835_sdhci.c +1 -1
index 39c93db275..c31f099f25 100644
@@ -209,7 +209,7 @@ static int bcm2835_sdhci_probe(struct udevice *dev)
 	priv->last_write = 0;
 
 	host->name = dev->name;
-	host->ioaddr = (void *)base;
+	host->ioaddr = (void *)(uintptr_t)base;
 	host->quirks = SDHCI_QUIRK_BROKEN_VOLTAGE | SDHCI_QUIRK_BROKEN_R1B |
 		SDHCI_QUIRK_WAIT_SEND_CMD | SDHCI_QUIRK_NO_HISPD_BIT;
 	host->max_clk = emmc_freq;
Signature · 3 lines
Seung-Woo Kim
Samsung Research
--
#4 lore raw

PATCH 1/1 mmc: bcm283x: fix int to pointer cast

Quoted 7 lines · Seung-Woo Kim

Hi Jaehoon,

Quoted 4 lines · Jaehoon Chung
Quoted 2 lines · Seung-Woo Kim

On build with 32 bit, there is a warning for int-to-pointer-cast. Fix the int to pointer cast by using uintptr_t.

Quoted 6 lines
Quoted 1 line

Could you share in more detail? I didn't see any warning with gcc 9.2 / 8.3 / 7.4 /6.5.

Sorry for not giving detail. If I applied PICe XHCI support [1], and build rpi_4_32b, then I got related warning.

If [1] is not applied, then this can be ignored.

This is actually discussed in a new series [1]. If you have the same finding there then we should include your patch to the series.

Please check and follow up there if necessary.

Regards,
Matthias

[1] https://www.mail-archive.com/u-boot at lists.denx.de/msg369283.html

Quoted 37 lines

[1]
https://patchwork.ozlabs.org/project/uboot/patch/20200504124523.23484-7-s.nawrocki at samsung.com/

Best Regards,
- Seung-Woo Kim

Quoted 29 lines

Best Regards,
Jaehoon Chung

Quoted 20 lines
---
 drivers/mmc/bcm2835_sdhci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/bcm2835_sdhci.c +1 -1
index 39c93db275..c31f099f25 100644
@@ -209,7 +209,7 @@ static int bcm2835_sdhci_probe(struct udevice *dev)
 	priv->last_write = 0;
 
 	host->name = dev->name;
-	host->ioaddr = (void *)base;
+	host->ioaddr = (void *)(uintptr_t)base;
 	host->quirks = SDHCI_QUIRK_BROKEN_VOLTAGE | SDHCI_QUIRK_BROKEN_R1B |
 		SDHCI_QUIRK_WAIT_SEND_CMD | SDHCI_QUIRK_NO_HISPD_BIT;
 	host->max_clk = emmc_freq;