From cbe1dacb25832e222f6ddcb91d91ad443c08629a Mon Sep 17 00:00:00 2001 From: stefanct Date: Wed, 17 Jul 2013 23:46:44 +0000 Subject: uintptr_t-ify map_flash_region functions. unsigned long is not the right type for manipulating pointer values. Since C99 there are suitable unsigned and signed types available, namely uintptr_t and intptr_t respectively. Use them in functions assigned to programmers' map_flash_region fields and their callers where applicable. This patch also changes the display width of all associated address values in physmap.c to 16/8 hex characters depending on the actual size by introducing a macro PRIxPTR_WIDTH and exploiting printf's * field width specifier. Signed-off-by: Stefan Tauner Acked-by: Carl-Daniel Hailfinger git-svn-id: https://code.coreboot.org/svn/flashrom/trunk@1701 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- dummyflasher.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'dummyflasher.c') diff --git a/dummyflasher.c b/dummyflasher.c index e2ec036..cc15b00 100644 --- a/dummyflasher.c +++ b/dummyflasher.c @@ -412,10 +412,10 @@ dummy_init_out: return 0; } -void *dummy_map(const char *descr, unsigned long phys_addr, size_t len) +void *dummy_map(const char *descr, uintptr_t phys_addr, size_t len) { - msg_pspew("%s: Mapping %s, 0x%lx bytes at 0x%08lx\n", - __func__, descr, (unsigned long)len, phys_addr); + msg_pspew("%s: Mapping %s, 0x%lx bytes at 0x%*" PRIxPTR "\n", + __func__, descr, (unsigned long)len, PRIxPTR_WIDTH, phys_addr); return (void *)phys_addr; } -- cgit v1.2.1