From 0058e8dfc9fc18d4eca65e9312495aceea0f8f54 Mon Sep 17 00:00:00 2001 From: Maciej Dudek Date: Wed, 14 Feb 2024 15:30:08 +0100 Subject: [PATCH] Improve code speed --- litex/soc/software/liblitedram/sdram.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/litex/soc/software/liblitedram/sdram.c b/litex/soc/software/liblitedram/sdram.c index 0a57db1353..62de279caf 100644 --- a/litex/soc/software/liblitedram/sdram.c +++ b/litex/soc/software/liblitedram/sdram.c @@ -347,7 +347,12 @@ static void print_scan_errors(unsigned int errors) { else printf("%x", errors); #else - printf("%d", errors == 0); + int no_errors = errors == 0; + if (no_errors) { + printf("1"); + } else { + printf("0"); + } #endif // SDRAM_LEVELING_SCAN_DISPLAY_HEX_DIV }