From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753225AbbEAA5E (ORCPT ); Thu, 30 Apr 2015 20:57:04 -0400 Received: from bear.ext.ti.com ([192.94.94.41]:41567 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752441AbbEAA5B (ORCPT ); Thu, 30 Apr 2015 20:57:01 -0400 Date: Thu, 30 Apr 2015 19:55:22 -0500 From: Felipe Balbi To: Stephen Boyd CC: Stefan Wahren , Mike Turquette , Subject: Re: [PATCH RESEND] clk: Fix JSON output in debugfs Message-ID: <20150501005522.GA6020@saruman.tx.rr.com> Reply-To: References: <1430325403-2647-1-git-send-email-stefan.wahren@i2se.com> <20150501003712.GD32407@codeaurora.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="PNTmBPCT7hxwcZjr" Content-Disposition: inline In-Reply-To: <20150501003712.GD32407@codeaurora.org> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --PNTmBPCT7hxwcZjr Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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. > >=20 > > So add the missing commas to fix it. > >=20 > > Fixes: 5279fc4 ("clk: add clk accuracy retrieval support") > > Signed-off-by: Stefan Wahren >=20 > Hmph, this regression is old, v3.14 days. We probably ought to > have a comment in here stating this should be JSON format. >=20 > Applied to clk-next with the comment below squashed in. >=20 > ----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; > =20 > + /* 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) =20 clk_prepare_unlock(); =20 - seq_printf(s, "}"); + seq_printf(s, "}\n"); return 0; } cheers --=20 balbi --PNTmBPCT7hxwcZjr Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJVQs76AAoJEIaOsuA1yqREPOwP/3WOFUBXUoqaBPOkzCBEz2LQ ScXKGwrT0lKIuNLE6wpMDliZodRI9S7rwz0aCDX6ASgwTb/eyTisLx9+uLeVhDkW seqaengPhu1tIjt304g4N5Y+tpvo6qeCMSqa+DEKCwLkj/yaNkVdV03i2RljNmbA kk447IzYCm7oexL0Sz7idKYMTIZOj4R6efPYJvivZoBB4CghyrYJVcmXfqyKxnei s80DIxSwVosuNDN46t500iuuZTTTf61S9ztUJxolgSEZF3o05Jk2yoZfser3Ru0I 0suLuzzEdNLuoq6/sBqB7+MisQ/kHiD58MyIrf4HTn1jxmb4YM+i2SGpn0FhVTi/ tGfcDxxpbNiHLSX6IwkrxKZyajea+hsn8nCEdZB88A0D19fRvZt7eI2YHx6RRGIV XXTnh7X3PnPKSr/5VWJoVIuKw8qoal1mTiarJpfI65TUSKfrGI1uWrRoUMsskwY/ YhkWgpC+pAMejuTsuL9pfswwzrchtT2kATj6pS40hiur7GpGGcHb9rTVBOMEHakn K11LygkfHH0RWYhfEjNp7OCePYuuvYHgEqLVbVkM24Gd4rtf6Zi5D+WGCkMaUZ5A dlywDjFvp/tzQFS1WHnYBDArViUywBgbCFDq+oElpE17JDdV732BNBkQ9sxgZu4N 5YQ1Exj1qRYevHoTCm6n =35VJ -----END PGP SIGNATURE----- --PNTmBPCT7hxwcZjr--