mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-20 05:31:15 +00:00
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>
This commit is contained in:
parent
0c27922e49
commit
728bf09827
2 changed files with 8 additions and 5 deletions
|
@ -42,8 +42,9 @@ typedef u64 psched_time_t;
|
|||
typedef long psched_tdiff_t;
|
||||
|
||||
/* Avoid doing 64 bit divide by 1000 */
|
||||
#define PSCHED_US2NS(x) ((s64)(x) << 10)
|
||||
#define PSCHED_NS2US(x) ((x) >> 10)
|
||||
#define PSCHED_SHIFT 10
|
||||
#define PSCHED_US2NS(x) ((s64)(x) << PSCHED_SHIFT)
|
||||
#define PSCHED_NS2US(x) ((x) >> PSCHED_SHIFT)
|
||||
|
||||
#define PSCHED_TICKS_PER_SEC PSCHED_NS2US(NSEC_PER_SEC)
|
||||
#define PSCHED_PASTPERFECT 0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue