]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
tc/util: make local functions static
authorStephen Hemminger <stephen@networkplumber.org>
Thu, 15 Nov 2018 22:36:36 +0000 (14:36 -0800)
committerStephen Hemminger <stephen@networkplumber.org>
Mon, 19 Nov 2018 19:42:44 +0000 (11:42 -0800)
The tc util library parse/print has functions only used locally
(and some dead code removed).

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
tc/tc_util.c
tc/tc_util.h

index a082c73c9350070463492c74c0201370f38a5943..82856a85170b6fdb2dfab42a8487882afbf6c93d 100644 (file)
@@ -190,7 +190,7 @@ static const struct rate_suffix {
        { NULL }
 };
 
-int parse_percent_rate(char *rate, const char *str, const char *dev)
+static int parse_percent_rate(char *rate, const char *str, const char *dev)
 {
        long dev_mbit;
        int ret;
@@ -409,7 +409,7 @@ void print_devname(enum output_type type, int ifindex)
                           "dev", "%s ", ifname);
 }
 
-void print_size(char *buf, int len, __u32 sz)
+static void print_size(char *buf, int len, __u32 sz)
 {
        double tmp = sz;
 
@@ -427,17 +427,6 @@ char *sprint_size(__u32 size, char *buf)
        return buf;
 }
 
-void print_qdisc_handle(char *buf, int len, __u32 h)
-{
-       snprintf(buf, len, "%x:", TC_H_MAJ(h)>>16);
-}
-
-char *sprint_qdisc_handle(__u32 h, char *buf)
-{
-       print_qdisc_handle(buf, SPRINT_BSIZE-1, h);
-       return buf;
-}
-
 static const char *action_n2a(int action)
 {
        static char buf[64];
@@ -709,7 +698,7 @@ int get_linklayer(unsigned int *val, const char *arg)
        return 0;
 }
 
-void print_linklayer(char *buf, int len, unsigned int linklayer)
+static void print_linklayer(char *buf, int len, unsigned int linklayer)
 {
        switch (linklayer) {
        case LINKLAYER_UNSPEC:
index e22c6da2569669237e0a0803bafc86f83bc92edf..825fea36a0809f6458a844f9d89d7acc6b891e01 100644 (file)
@@ -73,7 +73,6 @@ const char *get_tc_lib(void);
 struct qdisc_util *get_qdisc_kind(const char *str);
 struct filter_util *get_filter_kind(const char *str);
 
-int parse_percent_rate(char *rate, const char *str, const char *dev);
 int get_qdisc_handle(__u32 *h, const char *str);
 int get_rate(unsigned int *rate, const char *str);
 int get_percent_rate(unsigned int *rate, const char *str, const char *dev);
@@ -84,14 +83,10 @@ int get_size_and_cell(unsigned int *size, int *cell_log, char *str);
 int get_linklayer(unsigned int *val, const char *arg);
 
 void print_rate(char *buf, int len, __u64 rate);
-void print_size(char *buf, int len, __u32 size);
-void print_qdisc_handle(char *buf, int len, __u32 h);
-void print_linklayer(char *buf, int len, unsigned int linklayer);
 void print_devname(enum output_type type, int ifindex);
 
 char *sprint_rate(__u64 rate, char *buf);
 char *sprint_size(__u32 size, char *buf);
-char *sprint_qdisc_handle(__u32 h, char *buf);
 char *sprint_tc_classid(__u32 h, char *buf);
 char *sprint_ticks(__u32 ticks, char *buf);
 char *sprint_linklayer(unsigned int linklayer, char *buf);