public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Jiri Pirko <jiri@resnulli•us>
To: Stephen Hemminger <stephen@networkplumber•org>
Cc: Tariq Toukan <tariqt@mellanox•com>,
	David Ahern <dsahern@gmail•com>,
	netdev@vger•kernel.org, Moshe Shemesh <moshe@mellanox•com>,
	Aya Levin <ayal@mellanox•com>, Jiri Pirko <jiri@mellanox•com>
Subject: Re: [PATCH V2 iproute2 1/3] devlink: Add helper for left justification print
Date: Wed, 2 Oct 2019 19:14:55 +0200	[thread overview]
Message-ID: <20191002171455.GA2279@nanopsycho> (raw)
In-Reply-To: <20191002074804.3ad4e5e2@hermes.lan>

Wed, Oct 02, 2019 at 04:48:04PM CEST, stephen@networkplumber•org wrote:
>On Wed,  2 Oct 2019 17:35:14 +0300
>Tariq Toukan <tariqt@mellanox•com> wrote:
>
>>  static void pr_out_str(struct dl *dl, const char *name, const char *val)
>>  {
>> -	if (dl->json_output) {
>> +	__pr_out_indent_newline(dl);
>> +	if (dl->json_output)
>>  		jsonw_string_field(dl->jw, name, val);
>> -	} else {
>> -		if (g_indent_newline)
>> -			pr_out("%s %s", name, val);
>> -		else
>> -			pr_out(" %s %s", name, val);
>> -	}
>> +	else
>> +		pr_out("%s %s", name, val)
>
>Overall this looks like an improvement.
>
>Why doesn't devlink already use existing json_print infrastructure?

It will happen soon hopefully. I have it on the todo list and hopefully
also a person to do it :)

  reply	other threads:[~2019-10-02 17:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-02 14:35 [PATCH V2 iproute2 0/3] Devlink health FMSG fixes and enhancements Tariq Toukan
2019-10-02 14:35 ` [PATCH V2 iproute2 1/3] devlink: Add helper for left justification print Tariq Toukan
2019-10-02 14:48   ` Stephen Hemminger
2019-10-02 17:14     ` Jiri Pirko [this message]
2019-10-02 14:35 ` [PATCH V2 iproute2 2/3] devlink: Left justification on FMSG output Tariq Toukan
2019-10-02 14:35 ` [PATCH V2 iproute2 3/3] devlink: Fix inconsistency between command input and output Tariq Toukan
2019-10-09  3:23 ` [PATCH V2 iproute2 0/3] Devlink health FMSG fixes and enhancements Stephen Hemminger

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=20191002171455.GA2279@nanopsycho \
    --to=jiri@resnulli$(echo .)us \
    --cc=ayal@mellanox$(echo .)com \
    --cc=dsahern@gmail$(echo .)com \
    --cc=jiri@mellanox$(echo .)com \
    --cc=moshe@mellanox$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=stephen@networkplumber$(echo .)org \
    --cc=tariqt@mellanox$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox