From 57bbca93f12e0ddbde3e673070483e13521dfbdd Mon Sep 17 00:00:00 2001 From: Marcelo Povoa Date: Mon, 24 Feb 2014 10:00:26 -0800 Subject: [PATCH] cbmem: Fix 64-bit pointer related casts in dynamic_cbmem.c BUG=None BRANCH=none TEST=Build and run coreboot for foundation-armv8 target Change-Id: I7a382d42e1552d13b1feffc37848674f304adee2 Signed-off-by: Marcelo Povoa Reviewed-on: https://chromium-review.googlesource.com/187726 Reviewed-by: Aaron Durbin Reviewed-by: Stefan Reinauer Reviewed-by: David Hendricks --- src/lib/dynamic_cbmem.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lib/dynamic_cbmem.c b/src/lib/dynamic_cbmem.c index e21f96e372..ecfe5240c3 100644 --- a/src/lib/dynamic_cbmem.c +++ b/src/lib/dynamic_cbmem.c @@ -119,7 +119,7 @@ static inline void *get_root(void) if (pointer->magic != CBMEM_POINTER_MAGIC) return NULL; - return (void *)pointer->root; + return (void *)(uintptr_t)pointer->root; } static inline void cbmem_entry_assign(struct cbmem_entry *entry, @@ -200,9 +200,9 @@ static inline int cbmem_fail_recovery(void) static int validate_entries(struct cbmem_root *root) { unsigned int i; - u32 current_end; + uintptr_t current_end; - current_end = (u32)get_top_aligned(); + current_end = (uintptr_t)get_top_aligned(); printk(BIOS_DEBUG, "CBMEM: recovering %d/%d entries from root @ %p\n", root->num_entries, root->max_entries, root); @@ -272,14 +272,14 @@ int cbmem_initialize(void) static void *cbmem_base(void) { struct cbmem_root *root; - u32 low_addr; + uintptr_t low_addr; root = get_root(); if (root == NULL) return NULL; - low_addr = (u32)root; + low_addr = (uintptr_t)root; /* Assume the lowest address is the last one added. */ if (root->num_entries > 0) { @@ -413,7 +413,7 @@ u64 cbmem_entry_size(const struct cbmem_entry *entry) void *cbmem_entry_start(const struct cbmem_entry *entry) { - return (void *)entry->start; + return (void *)(uintptr_t)entry->start; }