]> rtime.felk.cvut.cz Git - lisovros/iproute2_canprio.git/commitdiff
Switch helpers tc_core_{time2ktime,ktime2time} from long to unsigned as well.
authorAndreas Henriksson <andreas@fatal.se>
Fri, 12 Oct 2007 11:49:49 +0000 (13:49 +0200)
committerStephen Hemminger <shemminger@linux-foundation.org>
Fri, 12 Oct 2007 23:06:21 +0000 (16:06 -0700)
Follow up patch to "Fix overflow in time2tick / tick2time." which switches
the remaining two helper functions from long to unsigned as well.
These functions are only used in "tc/q_hfsc.c" where both the passed argument
and the place the return value is stored are unsigned/u32 variables, so this
change should be safe to make but hasn't been tested as extensively as the
time2tick patch.

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
tc/tc_core.c
tc/tc_core.h

index fb898766972f704de0d8690f9d5a36448e14445e..8c3a2acce2cad83925635e2b92eed0c26d49950b 100644 (file)
@@ -45,12 +45,12 @@ unsigned tc_core_tick2time(unsigned tick)
        return tick/tick_in_usec;
 }
 
-long tc_core_time2ktime(long time)
+unsigned tc_core_time2ktime(unsigned time)
 {
        return time * clock_factor;
 }
 
-long tc_core_ktime2time(long ktime)
+unsigned tc_core_ktime2time(unsigned ktime)
 {
        return ktime / clock_factor;
 }
index b2a16bc32ffd1b6a1cdbcdd9497aa97e3965e57b..b1ede1eddf544c04794b72641ff34165c1161c29 100644 (file)
@@ -9,8 +9,8 @@
 int  tc_core_time2big(long time);
 unsigned tc_core_time2tick(unsigned time);
 unsigned tc_core_tick2time(unsigned tick);
-long tc_core_time2ktime(long time);
-long tc_core_ktime2time(long ktime);
+unsigned tc_core_time2ktime(unsigned time);
+unsigned tc_core_ktime2time(unsigned ktime);
 unsigned tc_calc_xmittime(unsigned rate, unsigned size);
 unsigned tc_calc_xmitsize(unsigned rate, unsigned ticks);
 int tc_calc_rtable(unsigned bps, __u32 *rtab, int cell_log, unsigned mtu, unsigned mpu);