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:
@@ -234,7 +234,7 @@ static int alarmtimer_suspend(struct device *dev)
|
||||
min = freezer_delta;
|
||||
expires = freezer_expires;
|
||||
type = freezer_alarmtype;
|
||||
freezer_delta = ktime_set(0, 0);
|
||||
freezer_delta = 0;
|
||||
spin_unlock_irqrestore(&freezer_delta_lock, flags);
|
||||
|
||||
rtc = alarmtimer_get_rtcdev();
|
||||
@@ -277,7 +277,7 @@ static int alarmtimer_suspend(struct device *dev)
|
||||
now = ktime_add(now, min);
|
||||
|
||||
/* Set alarm, if in the past reject suspend briefly to handle */
|
||||
ret = rtc_timer_start(rtc, &rtctimer, now, ktime_set(0, 0));
|
||||
ret = rtc_timer_start(rtc, &rtctimer, now, 0);
|
||||
if (ret < 0)
|
||||
__pm_wakeup_event(ws, MSEC_PER_SEC);
|
||||
return ret;
|
||||
|
Reference in New Issue
Block a user