From b9444280003a0cc758b63e9797ffc822a9ae2548 Mon Sep 17 00:00:00 2001 From: Honnappa Nagarahalli Date: Mon, 3 Jun 2019 15:46:45 -0500 Subject: [PATCH] rcu: fix format specifier in dump Use %u to fix argument type mismatch in fprintf. Coverity issue: 340074 Fixes: 64994b56cfd7 ("rcu: add RCU library supporting QSBR mechanism") Cc: stable@dpdk.org Signed-off-by: Honnappa Nagarahalli Reviewed-by: Ruifeng Wang --- lib/librte_rcu/rte_rcu_qsbr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/librte_rcu/rte_rcu_qsbr.c b/lib/librte_rcu/rte_rcu_qsbr.c index b4ed010459..de25464647 100644 --- a/lib/librte_rcu/rte_rcu_qsbr.c +++ b/lib/librte_rcu/rte_rcu_qsbr.c @@ -234,7 +234,7 @@ rte_rcu_qsbr_dump(FILE *f, struct rte_rcu_qsbr *v) id = i << __RTE_QSBR_THRID_INDEX_SHIFT; while (bmap) { t = __builtin_ctzl(bmap); - fprintf(f, "%d ", id + t); + fprintf(f, "%u ", id + t); bmap &= ~(1UL << t); } @@ -252,7 +252,7 @@ rte_rcu_qsbr_dump(FILE *f, struct rte_rcu_qsbr *v) id = i << __RTE_QSBR_THRID_INDEX_SHIFT; while (bmap) { t = __builtin_ctzl(bmap); - fprintf(f, "thread ID = %d, count = %"PRIu64", lock count = %u\n", + fprintf(f, "thread ID = %u, count = %"PRIu64", lock count = %u\n", id + t, __atomic_load_n( &v->qsbr_cnt[id + t].cnt, -- 2.20.1