diff options
author | Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> | 2013-07-17 23:46:44 +0000 |
---|---|---|
committer | Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> | 2013-07-17 23:46:44 +0000 |
commit | 305e0b999a7d452a845709d5558c17a31afe178c (patch) | |
tree | 3b65c3cd627ff55d683f26bf0819913a3e63c5d8 /dummyflasher.c | |
parent | 4a03865cd9b192e6e65b5dbc5a928af87322385d (diff) | |
download | ast2050-flashrom-305e0b999a7d452a845709d5558c17a31afe178c.zip ast2050-flashrom-305e0b999a7d452a845709d5558c17a31afe178c.tar.gz |
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.
Corresponding to flashrom svn r1701.
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Diffstat (limited to 'dummyflasher.c')
-rw-r--r-- | dummyflasher.c | 6 |
1 files changed, 3 insertions, 3 deletions
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; } |