From fd59e8d55bed79350995707f360be0f4152f51f3 Mon Sep 17 00:00:00 2001 From: Michal Sieron Date: Thu, 19 Jan 2023 17:45:36 +0100 Subject: [PATCH] liblitedram/bist: fix printf format warnings Use format constants for fixed width integer types to make it work on both 32-bit and 64-bit CPUs without warnings. Signed-off-by: Michal Sieron --- litex/soc/software/liblitedram/bist.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/litex/soc/software/liblitedram/bist.c b/litex/soc/software/liblitedram/bist.c index 3206e5eb8..53eb278e0 100644 --- a/litex/soc/software/liblitedram/bist.c +++ b/litex/soc/software/liblitedram/bist.c @@ -126,7 +126,7 @@ void sdram_bist(uint32_t burst_length, uint32_t random) uint64_t total_length; uint32_t total_errors; - printf("Starting SDRAM BIST with burst_length=%lu and random=%lu\n", burst_length, random); + printf("Starting SDRAM BIST with burst_length=%" PRIu32 " and random=%" PRIu32 "\n", burst_length, random); total_length = 0; total_errors = 0; @@ -139,7 +139,7 @@ void sdram_bist(uint32_t burst_length, uint32_t random) printf("WR-SPEED(MiB/s) RD-SPEED(MiB/s) TESTED(MiB) ERRORS\n"); } if (i%100 == 100-1) { - printf("%15lu %15lu %12llu %12lu\n", + printf("%15" PRIu32 " %15" PRIu32 "%12" PRIu64 "%12" PRIu32 "\n", compute_speed_mibs(wr_length, wr_ticks), compute_speed_mibs(rd_length, rd_ticks), total_length/(1024*1024),