aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2007-03-16 04:23:02 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-04-26 01:26:14 -0400
commit00c04af9df3d26e5a8093da850e982a7b6aeada7 (patch)
tree4764d2dd26f672f707fe513815a7745d03f46f43
parentfb983d4578e238b7f483b4f8f39f3a0f35d34d16 (diff)
[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>
-rw-r--r--include/net/pkt_sched.h3
-rw-r--r--net/sched/sch_hfsc.c12
-rw-r--r--net/sched/sch_htb.c2
3 files changed, 7 insertions, 10 deletions
diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h
index b090d55d5eb8..6555e57ff6c9 100644
--- a/include/net/pkt_sched.h
+++ b/include/net/pkt_sched.h
@@ -51,9 +51,6 @@ typedef long psched_tdiff_t;
51#define PSCHED_GET_TIME(stamp) \ 51#define PSCHED_GET_TIME(stamp) \
52 ((stamp) = PSCHED_NS2US(ktime_to_ns(ktime_get()))) 52 ((stamp) = PSCHED_NS2US(ktime_to_ns(ktime_get())))
53 53
54#define PSCHED_US2JIFFIE(usecs) usecs_to_jiffies(PSCHED_US2NS((usecs)) / NSEC_PER_USEC)
55#define PSCHED_JIFFIE2US(delay) PSCHED_NS2US(jiffies_to_usecs((delay)) * NSEC_PER_USEC)
56
57#define PSCHED_TDIFF(tv1, tv2) (long)((tv1) - (tv2)) 54#define PSCHED_TDIFF(tv1, tv2) (long)((tv1) - (tv2))
58#define PSCHED_TDIFF_SAFE(tv1, tv2, bound) \ 55#define PSCHED_TDIFF_SAFE(tv1, tv2, bound) \
59 min_t(long long, (tv1) - (tv2), bound) 56 min_t(long long, (tv1) - (tv2), bound)
diff --git a/net/sched/sch_hfsc.c b/net/sched/sch_hfsc.c
index 3cc2714fd5ae..5197b6caaf2d 100644
--- a/net/sched/sch_hfsc.c
+++ b/net/sched/sch_hfsc.c
@@ -434,8 +434,8 @@ m2sm(u32 m)
434 u64 sm; 434 u64 sm;
435 435
436 sm = ((u64)m << SM_SHIFT); 436 sm = ((u64)m << SM_SHIFT);
437 sm += PSCHED_JIFFIE2US(HZ) - 1; 437 sm += PSCHED_TICKS_PER_SEC - 1;
438 do_div(sm, PSCHED_JIFFIE2US(HZ)); 438 do_div(sm, PSCHED_TICKS_PER_SEC);
439 return sm; 439 return sm;
440} 440}
441 441
@@ -448,7 +448,7 @@ m2ism(u32 m)
448 if (m == 0) 448 if (m == 0)
449 ism = HT_INFINITY; 449 ism = HT_INFINITY;
450 else { 450 else {
451 ism = ((u64)PSCHED_JIFFIE2US(HZ) << ISM_SHIFT); 451 ism = ((u64)PSCHED_TICKS_PER_SEC << ISM_SHIFT);
452 ism += m - 1; 452 ism += m - 1;
453 do_div(ism, m); 453 do_div(ism, m);
454 } 454 }
@@ -461,7 +461,7 @@ d2dx(u32 d)
461{ 461{
462 u64 dx; 462 u64 dx;
463 463
464 dx = ((u64)d * PSCHED_JIFFIE2US(HZ)); 464 dx = ((u64)d * PSCHED_TICKS_PER_SEC);
465 dx += USEC_PER_SEC - 1; 465 dx += USEC_PER_SEC - 1;
466 do_div(dx, USEC_PER_SEC); 466 do_div(dx, USEC_PER_SEC);
467 return dx; 467 return dx;
@@ -473,7 +473,7 @@ sm2m(u64 sm)
473{ 473{
474 u64 m; 474 u64 m;
475 475
476 m = (sm * PSCHED_JIFFIE2US(HZ)) >> SM_SHIFT; 476 m = (sm * PSCHED_TICKS_PER_SEC) >> SM_SHIFT;
477 return (u32)m; 477 return (u32)m;
478} 478}
479 479
@@ -484,7 +484,7 @@ dx2d(u64 dx)
484 u64 d; 484 u64 d;
485 485
486 d = dx * USEC_PER_SEC; 486 d = dx * USEC_PER_SEC;
487 do_div(d, PSCHED_JIFFIE2US(HZ)); 487 do_div(d, PSCHED_TICKS_PER_SEC);
488 return (u32)d; 488 return (u32)d;
489} 489}
490 490
diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c
index 4d84200f097b..f76c20c0a109 100644
--- a/net/sched/sch_htb.c
+++ b/net/sched/sch_htb.c
@@ -1469,7 +1469,7 @@ static int htb_change_class(struct Qdisc *sch, u32 classid,
1469 /* set class to be in HTB_CAN_SEND state */ 1469 /* set class to be in HTB_CAN_SEND state */
1470 cl->tokens = hopt->buffer; 1470 cl->tokens = hopt->buffer;
1471 cl->ctokens = hopt->cbuffer; 1471 cl->ctokens = hopt->cbuffer;
1472 cl->mbuffer = PSCHED_JIFFIE2US(HZ * 60); /* 1min */ 1472 cl->mbuffer = 60 * PSCHED_TICKS_PER_SEC; /* 1min */
1473 PSCHED_GET_TIME(cl->t_c); 1473 PSCHED_GET_TIME(cl->t_c);
1474 cl->cmode = HTB_CAN_SEND; 1474 cl->cmode = HTB_CAN_SEND;
1475 1475