Skip to content
Snippets Groups Projects
Commit 0ea5a04f authored by Alexander Graf's avatar Alexander Graf Committed by Hans de Goede
Browse files

sunxi: Explicitly cast u32 pointer conversions


Some parts of the sunxi code cast explicitly between u32 values and pointers.
This is not a problem in practice, because all 64bit SoCs today only use the
lower 32 bits for their phyical address space. But we need to make sure that
the compiler is sure this is not an accident as well.

Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
Acked-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
parent 8434f035
No related branches found
No related tags found
No related merge requests found
......@@ -105,7 +105,7 @@ int sunxi_get_sid(unsigned int *sid)
int i;
for (i = 0; i< 4; i++)
sid[i] = readl(SUNXI_SID_BASE + 4 * i);
sid[i] = readl((ulong)SUNXI_SID_BASE + 4 * i);
return 0;
#else
......
......@@ -30,8 +30,8 @@ bool mctl_mem_matches(u32 offset)
{
/* Try to write different values to RAM at two addresses */
writel(0, CONFIG_SYS_SDRAM_BASE);
writel(0xaa55aa55, CONFIG_SYS_SDRAM_BASE + offset);
writel(0xaa55aa55, (ulong)CONFIG_SYS_SDRAM_BASE + offset);
/* Check if the same value is actually observed when reading back */
return readl(CONFIG_SYS_SDRAM_BASE) ==
readl(CONFIG_SYS_SDRAM_BASE + offset);
readl((ulong)CONFIG_SYS_SDRAM_BASE + offset);
}
......@@ -52,7 +52,7 @@ static struct sunxi_usb_phy {
int id;
int init_count;
int power_on_count;
int base;
ulong base;
} sunxi_usb_phy[] = {
{
.usb_rst_mask = CCM_USB_CTRL_PHY0_RST | CCM_USB_CTRL_PHY0_CLK,
......
......@@ -339,7 +339,7 @@ static int sunxi_mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd,
cmdval |= SUNXI_MMC_CMD_CHK_RESPONSE_CRC;
if (data) {
if ((u32) data->dest & 0x3) {
if ((u32)(long)data->dest & 0x3) {
error = -1;
goto out;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment