summaryrefslogtreecommitdiff
path: root/payloads/libpayload/drivers
diff options
context:
space:
mode:
authorJeremy Compostella <jeremy.compostella@intel.com>2020-09-22 15:26:39 -0700
committerPatrick Georgi <pgeorgi@google.com>2020-09-30 10:16:44 +0000
commit612ae2ec7c2cabfd2190ed9844d4b91704b24c85 (patch)
tree352d8127ee5128a9bf78ea5a4a281dada6b72334 /payloads/libpayload/drivers
parent05ea79cf53f8c425b688c322f750acdfb428198a (diff)
downloadcoreboot-612ae2ec7c2cabfd2190ed9844d4b91704b24c85.tar.xz
libpayload: use PRIu64 type to print u64
The appropriate way to print a u64 variable regardless of the current architecture is to use the PRI*64 macros. libpayload is mostly used in 32 bits but when ported to other projects and compiled in 64 bits it breaks the compilation. Change-Id: I479fd701f992701584d77d43c5cd5910f5ab7633 Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/45628 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'payloads/libpayload/drivers')
-rw-r--r--payloads/libpayload/drivers/options.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/payloads/libpayload/drivers/options.c b/payloads/libpayload/drivers/options.c
index 9e437f93f0..b6d234222d 100644
--- a/payloads/libpayload/drivers/options.c
+++ b/payloads/libpayload/drivers/options.c
@@ -26,8 +26,11 @@
* SUCH DAMAGE.
*/
+#define __STDC_FORMAT_MACROS
+
#include <libpayload.h>
#include <coreboot_tables.h>
+#include <inttypes.h>
u8 *mem_accessor_base;
@@ -325,7 +328,7 @@ int get_option_as_string(const struct nvram_accessor *nvram, struct cb_cmos_opti
/* only works on little endian.
26 bytes is enough for a 64bit value in decimal */
*dest = malloc(26);
- sprintf(*dest, "%llu", *(u64*)raw);
+ sprintf(*dest, "%" PRIu64, *(u64 *)raw);
break;
case 's':
*dest = strdup(raw);