1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-07-02 22:43:17 +02:00

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>
This commit is contained in:
Stefan Tauner
2013-07-17 23:46:44 +00:00
parent 4a03865cd9
commit 305e0b999a
6 changed files with 28 additions and 30 deletions

View File

@ -417,8 +417,7 @@ int programmer_shutdown(void)
return ret;
}
void *programmer_map_flash_region(const char *descr, unsigned long phys_addr,
size_t len)
void *programmer_map_flash_region(const char *descr, uintptr_t phys_addr, size_t len)
{
return programmer_table[programmer].map_flash_region(descr,
phys_addr, len);