lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Fri,  8 Mar 2024 09:16:01 -0800
From: Stephen Hemminger <stephen@...workplumber.org>
To: netdev@...r.kernel.org
Cc: Stephen Hemminger <stephen@...workplumber.org>
Subject: [PATCH iproute2-next 3/3] tc: remove no longer used helpers

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@...workplumber.org>
---
 tc/tc_core.c | 15 +++------------
 tc/tc_core.h |  2 --
 tc/tc_util.c |  5 -----
 tc/tc_util.h |  1 -
 4 files changed, 3 insertions(+), 20 deletions(-)

diff --git a/tc/tc_core.c b/tc/tc_core.c
index 871ceb45ff58..37547e9b3395 100644
--- a/tc/tc_core.c
+++ b/tc/tc_core.c
@@ -23,23 +23,14 @@
 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)
diff --git a/tc/tc_core.h b/tc/tc_core.h
index 6dab2727d199..7a986ac27a44 100644
--- a/tc/tc_core.h
+++ b/tc/tc_core.h
@@ -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);
diff --git a/tc/tc_util.c b/tc/tc_util.c
index aa7cf60faa6d..c293643dc80d 100644
--- a/tc/tc_util.c
+++ b/tc/tc_util.c
@@ -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, '/');
diff --git a/tc/tc_util.h b/tc/tc_util.h
index 623d9888a5ad..b7b9a097acd3 100644
--- a/tc/tc_util.h
+++ b/tc/tc_util.h
@@ -86,7 +86,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[],
-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ