From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: [PATCH iproute2-next 4/9] tc/cbq: use sprint_rate Date: Mon, 9 Jul 2018 12:48:51 -0700 Message-ID: <20180709194856.18922-5-stephen@networkplumber.org> References: <20180709194856.18922-1-stephen@networkplumber.org> Cc: Stephen Hemminger To: netdev@vger.kernel.org Return-path: Received: from mail-pf0-f177.google.com ([209.85.192.177]:44258 "EHLO mail-pf0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933002AbeGITtD (ORCPT ); Mon, 9 Jul 2018 15:49:03 -0400 Received: by mail-pf0-f177.google.com with SMTP id j3-v6so14366146pfh.11 for ; Mon, 09 Jul 2018 12:49:03 -0700 (PDT) In-Reply-To: <20180709194856.18922-1-stephen@networkplumber.org> Sender: netdev-owner@vger.kernel.org List-ID: From: Stephen Hemminger All other places in tc use sprint_rate. Signed-off-by: Stephen Hemminger --- tc/q_cbq.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/tc/q_cbq.c b/tc/q_cbq.c index e7f1a3bfaf5d..ad0170c41858 100644 --- a/tc/q_cbq.c +++ b/tc/q_cbq.c @@ -495,10 +495,9 @@ static int cbq_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt) } if (r) { - char buf[64]; - print_rate(buf, sizeof(buf), r->rate); - fprintf(f, "rate %s ", buf); + fprintf(f, "rate %s ", + sprint_rate(r->rate, b1)); linklayer = (r->linklayer & TC_LINKLAYER_MASK); if (linklayer > TC_LINKLAYER_ETHERNET || show_details) fprintf(f, "linklayer %s ", sprint_linklayer(linklayer, b2)); @@ -530,14 +529,12 @@ static int cbq_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt) fprintf(f, "prio %u", wrr->priority); else fprintf(f, "prio no-transmit"); - if (show_details) { - char buf[64]; + if (show_details) { fprintf(f, "/%u ", wrr->cpriority); - if (wrr->weight != 1) { - print_rate(buf, sizeof(buf), wrr->weight); - fprintf(f, "weight %s ", buf); - } + if (wrr->weight != 1) + fprintf(f, "weight %s ", + sprint_rate(wrr->weight, b1)); if (wrr->allot) fprintf(f, "allot %ub ", wrr->allot); } -- 2.18.0