mirror of
https://github.com/torvalds/linux.git
synced 2025-11-01 17:18:25 +02:00
powercap: idle_inject: use us_to_ktime() where appropriate
Convert values in microseconds to ktime using us_to_ktime() instead of multiplying them by NSEC_PER_USEC and using ns_to_ktime() for the conversion. Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com> Link: https://patch.msgid.link/20250813075433.464786-1-zhao.xichao@vivo.com [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
parent
c17b750b3a
commit
03cf825911
1 changed files with 2 additions and 3 deletions
|
|
@ -133,7 +133,7 @@ static enum hrtimer_restart idle_inject_timer_fn(struct hrtimer *timer)
|
|||
duration_us = READ_ONCE(ii_dev->run_duration_us);
|
||||
duration_us += READ_ONCE(ii_dev->idle_duration_us);
|
||||
|
||||
hrtimer_forward_now(timer, ns_to_ktime(duration_us * NSEC_PER_USEC));
|
||||
hrtimer_forward_now(timer, us_to_ktime(duration_us));
|
||||
|
||||
return HRTIMER_RESTART;
|
||||
}
|
||||
|
|
@ -232,8 +232,7 @@ int idle_inject_start(struct idle_inject_device *ii_dev)
|
|||
idle_inject_wakeup(ii_dev);
|
||||
|
||||
hrtimer_start(&ii_dev->timer,
|
||||
ns_to_ktime((idle_duration_us + run_duration_us) *
|
||||
NSEC_PER_USEC),
|
||||
us_to_ktime(idle_duration_us + run_duration_us),
|
||||
HRTIMER_MODE_REL);
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Reference in a new issue