All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Machata <me@pmachata.org>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: Petr Machata <me@pmachata.org>,
	netdev@vger.kernel.org, dsahern@gmail.com, Po.Liu@nxp.com,
	toke@toke.dk, dave.taht@gmail.com, edumazet@google.com,
	tahiliani@nitk.edu.in, vtlam@google.com, leon@kernel.org
Subject: Re: [PATCH iproute2-next 2/6] lib: Move print_rate() from tc here; modernize
Date: Tue, 01 Dec 2020 23:56:11 +0100	[thread overview]
Message-ID: <87h7p5nnjo.fsf@nvidia.com> (raw)
In-Reply-To: <20201130163547.23a06e79@hermes.local>


Stephen Hemminger <stephen@networkplumber.org> writes:

>> +int print_color_rate(bool use_iec, enum output_type t, enum color_attr color,
>> +		     const char *key, const char *fmt, unsigned long long rate);
>> +
>> +static inline int print_rate(bool use_iec, enum output_type t,
>> +			     const char *key, const char *fmt,
>> +			     unsigned long long rate)
>> +{
>> +	return print_color_rate(use_iec, t, COLOR_NONE, key, fmt, rate);
>> +}
>> +
>
> Overall this looks good, but is there any case where color output
> makes sense for this field? If not then why do all the color wrappers.

All the print_X functions in json_print comes with a print_color_X
flavor as well, even the ones where all clients just use the plain
output. (Notably the recently added on_off. Colors were even one of the
arguments in favor of putting that one to json_print, despite nobody
actually using them for on/off.)

  reply	other threads:[~2020-12-01 22:57 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-30 22:59 [PATCH iproute2-next 0/6] Move rate and size parsing and output to lib Petr Machata
2020-11-30 22:59 ` [PATCH iproute2-next 1/6] Move the use_iec declaration to the tools Petr Machata
2020-11-30 22:59 ` [PATCH iproute2-next 2/6] lib: Move print_rate() from tc here; modernize Petr Machata
2020-12-01  0:35   ` Stephen Hemminger
2020-12-01 22:56     ` Petr Machata [this message]
2020-11-30 22:59 ` [PATCH iproute2-next 3/6] lib: Move sprint_size() from tc here, add print_size() Petr Machata
2020-12-01  0:39   ` Stephen Hemminger
2020-12-01 22:41     ` Petr Machata
2020-12-02  4:07       ` David Ahern
2020-11-30 22:59 ` [PATCH iproute2-next 4/6] lib: Move get_rate(), get_rate64() from tc here Petr Machata
2020-11-30 22:59 ` [PATCH iproute2-next 5/6] lib: Move get_size() " Petr Machata
2020-11-30 22:59 ` [PATCH iproute2-next 6/6] lib: print_rate(): Fix formatting small rates in IEC mode Petr Machata

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=87h7p5nnjo.fsf@nvidia.com \
    --to=me@pmachata.org \
    --cc=Po.Liu@nxp.com \
    --cc=dave.taht@gmail.com \
    --cc=dsahern@gmail.com \
    --cc=edumazet@google.com \
    --cc=leon@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=stephen@networkplumber.org \
    --cc=tahiliani@nitk.edu.in \
    --cc=toke@toke.dk \
    --cc=vtlam@google.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.