Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull timer updates from Thomas Gleixner: "A rather smalish set of updates for timers and timekeeping: - Two core fixes to prevent potential undefinded behaviour about which gcc is complaining rightfully. - A fix to prevent stopping the tick on an (soon) offline CPU so it can complete the shutdown procedure. - Wait for clocks to stabilize before making decisions, so a not yet validated clock is not rejected. - The usual pile of fixes to the various clocksource drivers. - Core code typo and include fixlets" * 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: timekeeping: Include the correct header for errno definitions clocksource/drivers/ti-32k: Prevent ftrace recursion clocksource/mips-gic-timer: Stop checking cpu_has_counter clocksource/mips-gic-timer: Print an error if IRQ setup fails tick/nohz: Prevent stopping the tick on an offline CPU clocksource/drivers/oxnas: Add OX820 compatible clocksource/drivers/timer-atmel-pit: Simplify IRQ handler clocksource/drivers/timer-atmel-pit: Remove uselesss WARN_ON_ONCE clocksource/drivers/timer-atmel-pit: Drop at91sam926x_pit_common_init clocksource/drivers/moxart: Replace panic by pr_err clocksource/drivers/moxart: Replace setup_irq by request_irq clocksource/drivers/moxart: Add Aspeed support clocksource/drivers/moxart: Use struct to hold state clocksource/drivers/moxart: Refactor enable/disable time: Avoid undefined behaviour in ktime_add_safe() time: Avoid undefined behaviour in timespec64_add_safe() timekeeping: Prints the amounts of time spent during suspend clocksource: Defer override invalidation unless clock is unstable hrtimer: Spelling fixes
This commit is contained in:
@@ -63,6 +63,13 @@ static inline ktime_t ktime_set(const s64 secs, const unsigned long nsecs)
|
||||
#define ktime_add(lhs, rhs) \
|
||||
({ (ktime_t){ .tv64 = (lhs).tv64 + (rhs).tv64 }; })
|
||||
|
||||
/*
|
||||
* Same as ktime_add(), but avoids undefined behaviour on overflow; however,
|
||||
* this means that you must check the result for overflow yourself.
|
||||
*/
|
||||
#define ktime_add_unsafe(lhs, rhs) \
|
||||
({ (ktime_t){ .tv64 = (u64) (lhs).tv64 + (rhs).tv64 }; })
|
||||
|
||||
/*
|
||||
* Add a ktime_t variable and a scalar nanosecond value.
|
||||
* res = kt + nsval:
|
||||
|
@@ -5,6 +5,7 @@
|
||||
#include <linux/math64.h>
|
||||
|
||||
typedef __s64 time64_t;
|
||||
typedef __u64 timeu64_t;
|
||||
|
||||
/*
|
||||
* This wants to go into uapi/linux/time.h once we agreed about the
|
||||
|
@@ -1,7 +1,7 @@
|
||||
#ifndef _LINUX_TIMEKEEPING_H
|
||||
#define _LINUX_TIMEKEEPING_H
|
||||
|
||||
#include <asm-generic/errno-base.h>
|
||||
#include <linux/errno.h>
|
||||
|
||||
/* Included from linux/ktime.h */
|
||||
|
||||
|
Reference in New Issue
Block a user