Thread (28 messages) 28 messages, 6 authors, 2019-02-11
STALE2700d REVIEWED: 1 (0M)

[PATCH for-next 2/4] devlink: fix print of uint64_t

From: Aya Levin <hidden>
Date: 2019-02-10 18:29:39
Subsystem: the rest · Maintainer: Linus Torvalds

 This patch prints uint64_t with its corresponding format and avoid implicit
 cast to uint32_t.

Signed-off-by: Aya Levin <redacted>
Reviewed-by: Moshe Shemesh <redacted>
Reported-by: Maria Pasechnik <redacted>
---
 devlink/devlink.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/devlink/devlink.c b/devlink/devlink.c
index a05755385a49..46e2e41c5dfd 100644
--- a/devlink/devlink.c
+++ b/devlink/devlink.c
@@ -1628,7 +1628,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)
-- 
2.14.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help