lkml.org 
[lkml]   [2015]   [Apr]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH RESEND] clk: Fix JSON output in debugfs
On 04/29, Stefan Wahren wrote:
> key/value pairs in a JSON object must be separated by a comma.
> After adding the properties "accuracy" and "phase" the JSON output
> of /sys/kernel/debug/clk/clk_dump is invalid.
>
> So add the missing commas to fix it.
>
> Fixes: 5279fc4 ("clk: add clk accuracy retrieval support")
> Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>

Hmph, this regression is old, v3.14 days. We probably ought to
have a comment in here stating this should be JSON format.

Applied to clk-next with the comment below squashed in.

----8<----
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 5edbec6dfb20..b850a0ef5b9f 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -1974,6 +1974,7 @@ static void clk_dump_one(struct seq_file *s, struct clk_core *c, int level)
if (!c)
return;

+ /* This should be JSON format, i.e. elements separated with a comma */
seq_printf(s, "\"%s\": { ", c->name);
seq_printf(s, "\"enable_count\": %d,", c->enable_count);
seq_printf(s, "\"prepare_count\": %d,", c->prepare_count);
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project


\
 
 \ /
  Last update: 2015-05-01 03:01    [W:1.807 / U:0.276 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site