summaryrefslogtreecommitdiff
path: root/net/sched/sch_netem.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sched/sch_netem.c')
-rw-r--r--net/sched/sch_netem.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c
index 9b7af9f1272f..3bfd73344f76 100644
--- a/net/sched/sch_netem.c
+++ b/net/sched/sch_netem.c
@@ -301,7 +301,10 @@ static psched_tdiff_t tabledist(psched_tdiff_t mu, psched_tdiff_t sigma,
static psched_time_t packet_len_2_sched_time(unsigned int len, u32 rate)
{
- return PSCHED_NS2TICKS((u64)len * NSEC_PER_SEC / rate);
+ u64 ticks = (u64)len * NSEC_PER_SEC;
+
+ do_div(ticks, rate);
+ return PSCHED_NS2TICKS(ticks);
}
/*