]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
tc: remove no longer used helpers
authorStephen Hemminger <stephen@networkplumber.org>
Fri, 8 Mar 2024 17:16:01 +0000 (09:16 -0800)
committerStephen Hemminger <stephen@networkplumber.org>
Wed, 13 Mar 2024 16:56:29 +0000 (09:56 -0700)
The removal of tick usage in netem, means that some of the
helper functions in tc are no longer used and can be safely removed.
Other functions can be made static.

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

index 871ceb45ff58a2f97dffd537cd435240961903b3..37547e9b33952334bbfa78894dd50e3cf534d7ea 100644 (file)
 static double tick_in_usec = 1;
 static double clock_factor = 1;
 
-int tc_core_time2big(unsigned int time)
+static unsigned int tc_core_time2tick(unsigned int time)
 {
-       __u64 t = time;
-
-       t *= tick_in_usec;
-       return (t >> 32) != 0;
-}
-
-
-unsigned int tc_core_time2tick(unsigned int time)
-{
-       return time*tick_in_usec;
+       return time * tick_in_usec;
 }
 
 unsigned int tc_core_tick2time(unsigned int tick)
 {
-       return tick/tick_in_usec;
+       return tick / tick_in_usec;
 }
 
 unsigned int tc_core_time2ktime(unsigned int time)
index 6dab2727d1995a3717dd248679252d7ffb58d397..7a986ac27a44d82dd4eb69c3a4cfa78daf2e31a6 100644 (file)
@@ -12,8 +12,6 @@ enum link_layer {
 };
 
 
-int  tc_core_time2big(unsigned time);
-unsigned tc_core_time2tick(unsigned time);
 unsigned tc_core_tick2time(unsigned tick);
 unsigned tc_core_time2ktime(unsigned time);
 unsigned tc_core_ktime2time(unsigned ktime);
index aa7cf60faa6d17a626eab87b7df2249097806631..c293643dc80da41cc1251c87b9dac6309ac0d663 100644 (file)
@@ -257,11 +257,6 @@ tc_print_rate(enum output_type t, const char *key, const char *fmt,
        print_rate(use_iec, t, key, fmt, rate);
 }
 
-char *sprint_ticks(__u32 ticks, char *buf)
-{
-       return sprint_time(tc_core_tick2time(ticks), buf);
-}
-
 int get_size_and_cell(unsigned int *size, int *cell_log, char *str)
 {
        char *slash = strchr(str, '/');
index bbb2961dfe93ca66d6538d5a0faa4672e9e28113..250cf33a6d9683cc0f7afc875b108d6275e3d2d5 100644 (file)
@@ -87,7 +87,6 @@ void tc_print_rate(enum output_type t, const char *key, const char *fmt,
 void print_devname(enum output_type type, int ifindex);
 
 char *sprint_tc_classid(__u32 h, char *buf);
-char *sprint_ticks(__u32 ticks, char *buf);
 char *sprint_linklayer(unsigned int linklayer, char *buf);
 
 void print_tcstats_attr(FILE *fp, struct rtattr *tb[],