From: Stephen Hemminger <sthem...@microsoft.com> Only sprint_size is used, so fold it in.
Signed-off-by: Stephen Hemminger <sthem...@microsoft.com> --- 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