All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Mahesh Bandewar <mahesh@bandewar.net>
Cc: netdev <netdev@vger.kernel.org>, Mahesh Bandewar <maheshb@google.com>
Subject: Re: [PATCH iproute2] iproute: make clang happy
Date: Mon, 20 Aug 2018 15:50:38 -0700	[thread overview]
Message-ID: <20180820155038.30d0f08c@xeon-e3> (raw)
In-Reply-To: <20180820214215.218127-1-mahesh@bandewar.net>

On Mon, 20 Aug 2018 14:42:15 -0700
Mahesh Bandewar <mahesh@bandewar.net> wrote:

>  
>  		if (is_json_context()) {
> +			json_writer_t *jw;
> +
>  			open_json_object("bittiming");
>  			print_int(PRINT_ANY, "bitrate", NULL, bt->bitrate);
> -			jsonw_float_field_fmt(get_json_writer(),
> -					      "sample_point", "%.3f",
> -					      (float) bt->sample_point / 1000.);
> +			jw = get_json_writer();
> +			jsonw_name(jw, "sample_point");
> +			jsonw_printf(jw, "%.3f",
> +				     (float) bt->sample_point / 1000);

I think it would be better to get rid of the is_json_context() here in  the CAN code
and just use the print_json functions completely.  Most of the other code is able to
do that already.

  reply	other threads:[~2018-08-21  2:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-20 21:42 [PATCH iproute2] iproute: make clang happy Mahesh Bandewar
2018-08-20 22:50 ` Stephen Hemminger [this message]
2018-08-21  0:32   ` Mahesh Bandewar (महेश बंडेवार)
2018-08-20 22:52 ` Stephen Hemminger
2018-08-20 23:38   ` Mahesh Bandewar (महेश बंडेवार)
2018-08-20 23:44     ` Mahesh Bandewar (महेश बंडेवार)
2018-08-21  0:33       ` Mahesh Bandewar (महेश बंडेवार)
2018-08-21  0:52       ` Stephen Hemminger
2018-08-21 16:19         ` Mahesh Bandewar (महेश बंडेवार)

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=20180820155038.30d0f08c@xeon-e3 \
    --to=stephen@networkplumber.org \
    --cc=mahesh@bandewar.net \
    --cc=maheshb@google.com \
    --cc=netdev@vger.kernel.org \
    /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.