[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150501005522.GA6020@saruman.tx.rr.com>
Date: Thu, 30 Apr 2015 19:55:22 -0500
From: Felipe Balbi <balbi@...com>
To: Stephen Boyd <sboyd@...eaurora.org>
CC: Stefan Wahren <stefan.wahren@...e.com>,
Mike Turquette <mturquette@...aro.org>,
<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH RESEND] clk: Fix JSON output in debugfs
On Thu, Apr 30, 2015 at 05:37:12PM -0700, Stephen Boyd wrote:
> 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@...e.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);
you probably want to a newline character after all clocks have been
dumped.
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 459ce9da13e0..c2de94238e75 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -276,7 +276,7 @@ static int clk_dump(struct seq_file *s, void *data)
clk_prepare_unlock();
- seq_printf(s, "}");
+ seq_printf(s, "}\n");
return 0;
}
cheers
--
balbi
Download attachment "signature.asc" of type "application/pgp-signature" (820 bytes)
Powered by blists - more mailing lists