* [PATCH] Switch helpers tc_core_{time2ktime,ktime2time} from long to unsigned as well.
@ 2007-10-12 11:49 Andreas Henriksson
2007-10-12 11:56 ` [PATCH] Also do tc_core_time2big argument (long->unsigned) Andreas Henriksson
0 siblings, 1 reply; 4+ messages in thread
From: Andreas Henriksson @ 2007-10-12 11:49 UTC (permalink / raw)
To: shemminger; +Cc: netdev, Andreas Henriksson
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>
---
tc/tc_core.c | 4 ++--
tc/tc_core.h | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/tc/tc_core.c b/tc/tc_core.c
index fb89876..8c3a2ac 100644
--- a/tc/tc_core.c
+++ b/tc/tc_core.c
@@ -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;
}
diff --git a/tc/tc_core.h b/tc/tc_core.h
index b2a16bc..b1ede1e 100644
--- a/tc/tc_core.h
+++ b/tc/tc_core.h
@@ -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);
--
1.5.3.4
^ permalink raw reply related [flat|nested] 4+ messages in thread* [PATCH] Also do tc_core_time2big argument (long->unsigned).
2007-10-12 11:49 [PATCH] Switch helpers tc_core_{time2ktime,ktime2time} from long to unsigned as well Andreas Henriksson
@ 2007-10-12 11:56 ` Andreas Henriksson
2007-10-12 12:02 ` Patrick McHardy
0 siblings, 1 reply; 4+ messages in thread
From: Andreas Henriksson @ 2007-10-12 11:56 UTC (permalink / raw)
To: shemminger; +Cc: netdev, Andreas Henriksson
tc_core_time2big only used in tc/q_netem.c where it gets passed an unsigned.
Signed-off-by: Andreas Henriksson <andreas@fatal.se>
---
tc/tc_core.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/tc/tc_core.c b/tc/tc_core.c
index 8c3a2ac..1365e08 100644
--- a/tc/tc_core.c
+++ b/tc/tc_core.c
@@ -26,7 +26,7 @@
static double tick_in_usec = 1;
static double clock_factor = 1;
-int tc_core_time2big(long time)
+int tc_core_time2big(unsigned time)
{
__u64 t = time;
--
1.5.3.4
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] Also do tc_core_time2big argument (long->unsigned).
2007-10-12 11:56 ` [PATCH] Also do tc_core_time2big argument (long->unsigned) Andreas Henriksson
@ 2007-10-12 12:02 ` Patrick McHardy
2007-10-12 12:37 ` Andreas Henriksson
0 siblings, 1 reply; 4+ messages in thread
From: Patrick McHardy @ 2007-10-12 12:02 UTC (permalink / raw)
To: Andreas Henriksson; +Cc: shemminger, netdev
Andreas Henriksson wrote:
> tc_core_time2big only used in tc/q_netem.c where it gets passed an unsigned.
>
> Signed-off-by: Andreas Henriksson <andreas@fatal.se>
> ---
> tc/tc_core.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
Seems to be missing a tc_core.h update.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] Also do tc_core_time2big argument (long->unsigned).
2007-10-12 12:02 ` Patrick McHardy
@ 2007-10-12 12:37 ` Andreas Henriksson
0 siblings, 0 replies; 4+ messages in thread
From: Andreas Henriksson @ 2007-10-12 12:37 UTC (permalink / raw)
To: shemminger; +Cc: netdev, Patrick McHardy, Andreas Henriksson
tc_core_time2big only used in tc/q_netem.c where it gets passed an unsigned.
Signed-off-by: Andreas Henriksson <andreas@fatal.se>
---
tc/tc_core.c | 2 +-
tc/tc_core.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/tc/tc_core.c b/tc/tc_core.c
index 8c3a2ac..1365e08 100644
--- a/tc/tc_core.c
+++ b/tc/tc_core.c
@@ -26,7 +26,7 @@
static double tick_in_usec = 1;
static double clock_factor = 1;
-int tc_core_time2big(long time)
+int tc_core_time2big(unsigned time)
{
__u64 t = time;
diff --git a/tc/tc_core.h b/tc/tc_core.h
index b1ede1e..3a0ed7c 100644
--- a/tc/tc_core.h
+++ b/tc/tc_core.h
@@ -6,7 +6,7 @@
#define TIME_UNITS_PER_SEC 1000000
-int tc_core_time2big(long time);
+int tc_core_time2big(unsigned time);
unsigned tc_core_time2tick(unsigned time);
unsigned tc_core_tick2time(unsigned tick);
unsigned tc_core_time2ktime(unsigned time);
--
1.5.3.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-10-12 12:37 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-12 11:49 [PATCH] Switch helpers tc_core_{time2ktime,ktime2time} from long to unsigned as well Andreas Henriksson
2007-10-12 11:56 ` [PATCH] Also do tc_core_time2big argument (long->unsigned) Andreas Henriksson
2007-10-12 12:02 ` Patrick McHardy
2007-10-12 12:37 ` Andreas Henriksson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).