From: Felipe Balbi <balbi@ti.com>
To: Stephen Boyd <sboyd@codeaurora.org>
Cc: Stefan Wahren <stefan.wahren@i2se.com>,
Mike Turquette <mturquette@linaro.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH RESEND] clk: Fix JSON output in debugfs
Date: Thu, 30 Apr 2015 19:55:22 -0500 [thread overview]
Message-ID: <20150501005522.GA6020@saruman.tx.rr.com> (raw)
In-Reply-To: <20150501003712.GD32407@codeaurora.org>
[-- Attachment #1: Type: text/plain, Size: 1625 bytes --]
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@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);
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
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2015-05-01 0:57 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-29 16:36 [PATCH RESEND] clk: Fix JSON output in debugfs Stefan Wahren
2015-05-01 0:37 ` Stephen Boyd
2015-05-01 0:48 ` Stefan Wahren
2015-05-01 0:55 ` Felipe Balbi [this message]
2015-05-01 1:34 ` Stephen Boyd
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150501005522.GA6020@saruman.tx.rr.com \
--to=balbi@ti.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mturquette@linaro.org \
--cc=sboyd@codeaurora.org \
--cc=stefan.wahren@i2se.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.