[NET_SCHED]: turn PSCHED_TDIFF_SAFE into inline function

Also rename to psched_tdiff_bounded.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Patrick McHardy
2007-03-23 11:29:11 -07:00
committed by David S. Miller
parent 8edc0c31d6
commit 03cc45c0a5
5 changed files with 14 additions and 10 deletions

View File

@@ -298,8 +298,8 @@ static int tcf_act_police(struct sk_buff *skb, struct tc_action *a,
PSCHED_GET_TIME(now);
toks = PSCHED_TDIFF_SAFE(now, police->tcfp_t_c,
police->tcfp_burst);
toks = psched_tdiff_bounded(now, police->tcfp_t_c,
police->tcfp_burst);
if (police->tcfp_P_tab) {
ptoks = toks + police->tcfp_ptoks;
if (ptoks > (long)L2T_P(police, police->tcfp_mtu))
@@ -544,8 +544,8 @@ int tcf_police(struct sk_buff *skb, struct tcf_police *police)
}
PSCHED_GET_TIME(now);
toks = PSCHED_TDIFF_SAFE(now, police->tcfp_t_c,
police->tcfp_burst);
toks = psched_tdiff_bounded(now, police->tcfp_t_c,
police->tcfp_burst);
if (police->tcfp_P_tab) {
ptoks = toks + police->tcfp_ptoks;
if (ptoks > (long)L2T_P(police, police->tcfp_mtu))