ktime: Cleanup ktime_set() usage
ktime_set(S,N) was required for the timespec storage type and is still useful for situations where a Seconds and Nanoseconds part of a time value needs to be converted. For anything where the Seconds argument is 0, this is pointless and can be replaced with a simple assignment. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Peter Zijlstra <peterz@infradead.org>
This commit is contained in:
@@ -333,7 +333,7 @@ void ap_wait(enum ap_wait wait)
|
||||
case AP_WAIT_TIMEOUT:
|
||||
spin_lock_bh(&ap_poll_timer_lock);
|
||||
if (!hrtimer_is_queued(&ap_poll_timer)) {
|
||||
hr_time = ktime_set(0, poll_timeout);
|
||||
hr_time = poll_timeout;
|
||||
hrtimer_forward_now(&ap_poll_timer, hr_time);
|
||||
hrtimer_restart(&ap_poll_timer);
|
||||
}
|
||||
@@ -860,7 +860,7 @@ static ssize_t poll_timeout_store(struct bus_type *bus, const char *buf,
|
||||
time > 120000000000ULL)
|
||||
return -EINVAL;
|
||||
poll_timeout = time;
|
||||
hr_time = ktime_set(0, poll_timeout);
|
||||
hr_time = poll_timeout;
|
||||
|
||||
spin_lock_bh(&ap_poll_timer_lock);
|
||||
hrtimer_cancel(&ap_poll_timer);
|
||||
|
Reference in New Issue
Block a user