diff options
author | Jarek Poplawski <jarkao2@gmail.com> | 2009-06-08 18:05:00 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-06-09 08:25:29 -0400 |
commit | 728bf09827d350cdaa1f093170e745e8dac49b7a (patch) | |
tree | 2a493b68ce1414ff9ae91d759d2ffe2f4fb4560a /include/net | |
parent | 0c27922e4933ceb86644f4a9b1af212ffe5aad75 (diff) |
pkt_sched: Use PSCHED_SHIFT in PSCHED time conversion
Use PSCHED_SHIFT constant instead of '10' in PSCHED_US2NS() and
PSCHED_NS2US() macros to enable changing this value later.
Additionally use PSCHED_SHIFT in sch_hfsc SM_SHIFT and ISM_SHIFT
definitions. This part of the patch is based on feedback from
Patrick McHardy <kaber@trash.net>.
Reported-by: Antonio Almeida <vexwek@gmail.com>
Tested-by: Antonio Almeida <vexwek@gmail.com>
Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/pkt_sched.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h index e37fe3129c17..cd0e026d4f6a 100644 --- a/include/net/pkt_sched.h +++ b/include/net/pkt_sched.h | |||
@@ -42,8 +42,9 @@ typedef u64 psched_time_t; | |||
42 | typedef long psched_tdiff_t; | 42 | typedef long psched_tdiff_t; |
43 | 43 | ||
44 | /* Avoid doing 64 bit divide by 1000 */ | 44 | /* Avoid doing 64 bit divide by 1000 */ |
45 | #define PSCHED_US2NS(x) ((s64)(x) << 10) | 45 | #define PSCHED_SHIFT 10 |
46 | #define PSCHED_NS2US(x) ((x) >> 10) | 46 | #define PSCHED_US2NS(x) ((s64)(x) << PSCHED_SHIFT) |
47 | #define PSCHED_NS2US(x) ((x) >> PSCHED_SHIFT) | ||
47 | 48 | ||
48 | #define PSCHED_TICKS_PER_SEC PSCHED_NS2US(NSEC_PER_SEC) | 49 | #define PSCHED_TICKS_PER_SEC PSCHED_NS2US(NSEC_PER_SEC) |
49 | #define PSCHED_PASTPERFECT 0 | 50 | #define PSCHED_PASTPERFECT 0 |