From: Aya Levin Date: Thu, 28 Feb 2019 12:12:55 +0000 (+0200) Subject: devlink: Fix print of uint64_t X-Git-Tag: v5.4.0~141^2~9 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=86648a196066a533f7b1841d4430f6ba6387c480;p=mirror_iproute2.git devlink: Fix print of uint64_t This patch prints uint64_t with its corresponding format and avoid implicit cast to uint32_t. Signed-off-by: Aya Levin Reviewed-by: Moshe Shemesh Acked-by: Jiri Pirko Signed-off-by: David Ahern --- diff --git a/devlink/devlink.c b/devlink/devlink.c index a774b196..8a28b5d5 100644 --- a/devlink/devlink.c +++ b/devlink/devlink.c @@ -1651,7 +1651,14 @@ static void pr_out_u64(struct dl *dl, const char *name, uint64_t val) if (val == (uint64_t) -1) return pr_out_str(dl, name, "unlimited"); - return pr_out_uint(dl, name, val); + if (dl->json_output) { + jsonw_u64_field(dl->jw, name, val); + } else { + if (g_indent_newline) + pr_out("%s %lu", name, val); + else + pr_out(" %s %lu", name, val); + } } static void pr_out_region_chunk_start(struct dl *dl, uint64_t addr)