mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 19:56:18 +00:00
[NET_SCHED]: kill jiffie conversion macros
Now that all packet schedulers have been converted to hrtimers most users of PSCHED_JIFFIE2US and PSCHED_US2JIFFIE are gone. The remaining users use it to convert external time units to packet scheduler clock ticks, so use PSCHED_TICKS_PER_SEC instead. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
fb983d4578
commit
00c04af9df
3 changed files with 7 additions and 10 deletions
|
@ -51,9 +51,6 @@ typedef long psched_tdiff_t;
|
|||
#define PSCHED_GET_TIME(stamp) \
|
||||
((stamp) = PSCHED_NS2US(ktime_to_ns(ktime_get())))
|
||||
|
||||
#define PSCHED_US2JIFFIE(usecs) usecs_to_jiffies(PSCHED_US2NS((usecs)) / NSEC_PER_USEC)
|
||||
#define PSCHED_JIFFIE2US(delay) PSCHED_NS2US(jiffies_to_usecs((delay)) * NSEC_PER_USEC)
|
||||
|
||||
#define PSCHED_TDIFF(tv1, tv2) (long)((tv1) - (tv2))
|
||||
#define PSCHED_TDIFF_SAFE(tv1, tv2, bound) \
|
||||
min_t(long long, (tv1) - (tv2), bound)
|
||||
|
|
|
@ -434,8 +434,8 @@ m2sm(u32 m)
|
|||
u64 sm;
|
||||
|
||||
sm = ((u64)m << SM_SHIFT);
|
||||
sm += PSCHED_JIFFIE2US(HZ) - 1;
|
||||
do_div(sm, PSCHED_JIFFIE2US(HZ));
|
||||
sm += PSCHED_TICKS_PER_SEC - 1;
|
||||
do_div(sm, PSCHED_TICKS_PER_SEC);
|
||||
return sm;
|
||||
}
|
||||
|
||||
|
@ -448,7 +448,7 @@ m2ism(u32 m)
|
|||
if (m == 0)
|
||||
ism = HT_INFINITY;
|
||||
else {
|
||||
ism = ((u64)PSCHED_JIFFIE2US(HZ) << ISM_SHIFT);
|
||||
ism = ((u64)PSCHED_TICKS_PER_SEC << ISM_SHIFT);
|
||||
ism += m - 1;
|
||||
do_div(ism, m);
|
||||
}
|
||||
|
@ -461,7 +461,7 @@ d2dx(u32 d)
|
|||
{
|
||||
u64 dx;
|
||||
|
||||
dx = ((u64)d * PSCHED_JIFFIE2US(HZ));
|
||||
dx = ((u64)d * PSCHED_TICKS_PER_SEC);
|
||||
dx += USEC_PER_SEC - 1;
|
||||
do_div(dx, USEC_PER_SEC);
|
||||
return dx;
|
||||
|
@ -473,7 +473,7 @@ sm2m(u64 sm)
|
|||
{
|
||||
u64 m;
|
||||
|
||||
m = (sm * PSCHED_JIFFIE2US(HZ)) >> SM_SHIFT;
|
||||
m = (sm * PSCHED_TICKS_PER_SEC) >> SM_SHIFT;
|
||||
return (u32)m;
|
||||
}
|
||||
|
||||
|
@ -484,7 +484,7 @@ dx2d(u64 dx)
|
|||
u64 d;
|
||||
|
||||
d = dx * USEC_PER_SEC;
|
||||
do_div(d, PSCHED_JIFFIE2US(HZ));
|
||||
do_div(d, PSCHED_TICKS_PER_SEC);
|
||||
return (u32)d;
|
||||
}
|
||||
|
||||
|
|
|
@ -1469,7 +1469,7 @@ static int htb_change_class(struct Qdisc *sch, u32 classid,
|
|||
/* set class to be in HTB_CAN_SEND state */
|
||||
cl->tokens = hopt->buffer;
|
||||
cl->ctokens = hopt->cbuffer;
|
||||
cl->mbuffer = PSCHED_JIFFIE2US(HZ * 60); /* 1min */
|
||||
cl->mbuffer = 60 * PSCHED_TICKS_PER_SEC; /* 1min */
|
||||
PSCHED_GET_TIME(cl->t_c);
|
||||
cl->cmode = HTB_CAN_SEND;
|
||||
|
||||
|
|
Loading…
Reference in a new issue