]> git.proxmox.com Git - mirror_iproute2.git/commitdiff
devlink: Fix print of uint64_t
authorAya Levin <ayal@mellanox.com>
Thu, 28 Feb 2019 12:12:55 +0000 (14:12 +0200)
committerDavid Ahern <dsahern@gmail.com>
Thu, 28 Feb 2019 15:54:32 +0000 (07:54 -0800)
This patch prints uint64_t with its corresponding format and avoid implicit
cast to uint32_t.

Signed-off-by: Aya Levin <ayal@mellanox.com>
Reviewed-by: Moshe Shemesh <moshe@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David Ahern <dsahern@gmail.com>
devlink/devlink.c

index a774b196b7fdb24e1a2cd1bc79ccefdaa63b1c9c..8a28b5d5c26fd0e681dbc8884867e701ce75bb69 100644 (file)
@@ -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)