From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: [PATCH iproute2-next 6/9] tc/util: remove unused print_size Date: Mon, 9 Jul 2018 12:48:53 -0700 Message-ID: <20180709194856.18922-7-stephen@networkplumber.org> References: <20180709194856.18922-1-stephen@networkplumber.org> Cc: Stephen Hemminger To: netdev@vger.kernel.org Return-path: Received: from mail-pg1-f182.google.com ([209.85.215.182]:43877 "EHLO mail-pg1-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932998AbeGITtF (ORCPT ); Mon, 9 Jul 2018 15:49:05 -0400 Received: by mail-pg1-f182.google.com with SMTP id v13-v6so1466666pgr.10 for ; Mon, 09 Jul 2018 12:49:05 -0700 (PDT) In-Reply-To: <20180709194856.18922-1-stephen@networkplumber.org> Sender: netdev-owner@vger.kernel.org List-ID: From: Stephen Hemminger Only sprint_size is used, so fold it in. Signed-off-by: Stephen Hemminger --- tc/tc_util.c | 7 ++----- tc/tc_util.h | 1 - 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/tc/tc_util.c b/tc/tc_util.c index f5ffe3443892..01e131b5c5d7 100644 --- a/tc/tc_util.c +++ b/tc/tc_util.c @@ -451,8 +451,9 @@ void print_devname(enum output_type type, int ifindex) "dev", "%s ", ifname); } -void print_size(char *buf, int len, __u32 sz) +char *sprint_size(__u32 sz, char *buf) { + const size_t len = SPRINT_BSIZE - 1; double tmp = sz; if (sz >= 1024*1024 && fabs(1024*1024*rint(tmp/(1024*1024)) - sz) < 1024) @@ -461,11 +462,7 @@ void print_size(char *buf, int len, __u32 sz) snprintf(buf, len, "%gKb", rint(tmp/1024)); else snprintf(buf, len, "%ub", sz); -} -char *sprint_size(__u32 size, char *buf) -{ - print_size(buf, SPRINT_BSIZE-1, size); return buf; } diff --git a/tc/tc_util.h b/tc/tc_util.h index 56e214cbc8de..01c6a09a8839 100644 --- a/tc/tc_util.h +++ b/tc/tc_util.h @@ -84,7 +84,6 @@ int get_size_and_cell(unsigned int *size, int *cell_log, char *str); int get_time(unsigned int *time, const char *str); int get_linklayer(unsigned int *val, const char *arg); -void print_size(char *buf, int len, __u32 size); void print_qdisc_handle(char *buf, int len, __u32 h); void print_time(char *buf, int len, __u32 time); void print_linklayer(char *buf, int len, unsigned int linklayer); -- 2.18.0