[PATCH/committed] sim: dv-cfi: fix printf format

Message ID 20210424041905.12624-1-vapier@gentoo.org
State New
Headers show
Series
  • [PATCH/committed] sim: dv-cfi: fix printf format
Related show

Commit Message

Wei-min Pan via Gdb-patches April 24, 2021, 4:19 a.m.
Use the existing PRI constants to select the right format rather than
assume signed_cell is always %u.  Fixes building for riscv64.
---
 sim/common/ChangeLog | 4 ++++
 sim/common/dv-cfi.c  | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

-- 
2.30.2

Patch

diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog
index ed4d9f7da65b..516e214f0112 100644
--- a/sim/common/ChangeLog
+++ b/sim/common/ChangeLog
@@ -1,3 +1,7 @@ 
+2021-04-24  Mike Frysinger  <vapier@gentoo.org>
+
+	* dv-cfi.c (attach_cfi_regs): Change %u to PRIiTC.
+
 2021-04-24  Mike Frysinger  <vapier@gentoo.org>
 
 	* sim-options.c (ARG_HASH_SIZE): Increase to 256.
diff --git a/sim/common/dv-cfi.c b/sim/common/dv-cfi.c
index afc020a9f4b8..b8652271752d 100644
--- a/sim/common/dv-cfi.c
+++ b/sim/common/dv-cfi.c
@@ -610,7 +610,7 @@  attach_cfi_regs (struct hw *me, struct cfi *cfi)
     if (cfi_cmdsets[i]->id == ival)
       cfi->cmdset = cfi_cmdsets[i];
   if (cfi->cmdset == NULL)
-    hw_abort (me, "cmdset %u not supported", ival);
+    hw_abort (me, "cmdset %" PRIiTC " not supported", ival);
 
   if (ret == 2)
     {