]> git.kernelconcepts.de Git - karo-tx-uboot.git/commit
vsprintf: Add modifier for phys_addr_t
authorThierry Reding <treding@nvidia.com>
Thu, 13 Nov 2014 01:26:47 +0000 (18:26 -0700)
committerTom Rini <trini@ti.com>
Sun, 23 Nov 2014 11:49:01 +0000 (06:49 -0500)
commit1eebd14b79024f34925b79cb264242fac1bdc1b9
treed21295fa69298fc1c9116cda4ffc8a26bc2de81f
parent59e890ef7bf5b80d96802e115255f969491ef645
vsprintf: Add modifier for phys_addr_t

Provide a new modifier to vsprintf() to print phys_addr_t variables to
avoid having to cast or #ifdef when printing them out. The %pa modifier
is used for this purpose, so phys_addr_t variables need to be passed by
reference, like so:

phys_addr_t start = 0;

printf("start: %pa\n", &start);

Depending on the size of phys_addr_t this will print out the address
with 8 or 16 hexadecimal digits following a 0x prefix.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
lib/vsprintf.c