mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-07 04:12:04 -04:00
Merge "kernel: time: Fix accuracy for low resolution timer"
This commit is contained in:
commit
7b80147165
1 changed files with 5 additions and 1 deletions
|
|
@ -493,7 +493,11 @@ static inline void timer_set_idx(struct timer_list *timer, unsigned int idx)
|
|||
*/
|
||||
static inline unsigned calc_index(unsigned expires, unsigned lvl)
|
||||
{
|
||||
expires = (expires + LVL_GRAN(lvl)) >> LVL_SHIFT(lvl);
|
||||
if (lvl != 0 && (expires & ~(UINT_MAX << LVL_SHIFT(lvl))))
|
||||
expires = (expires + LVL_GRAN(lvl)) >> LVL_SHIFT(lvl);
|
||||
else
|
||||
expires = expires >> LVL_SHIFT(lvl);
|
||||
|
||||
return LVL_OFFS(lvl) + (expires & LVL_MASK);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue