From: Thomas Gleixner The 32 bit implementation of ktime_to_ns returns unsigned value, while the 64 bit version correctly returns an signed value. There is no current user affected by this, but it has to be fixed, as ktime values can be negative. Pointed-out-by: Helmut Duregger Signed-off-by: Thomas Gleixner Acked-by: Ingo Molnar Signed-off-by: Andrew Morton --- include/linux/ktime.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff -puN include/linux/ktime.h~ktime-fix-signed--unsigned-mismatch-in-ktime_to_ns include/linux/ktime.h --- a/include/linux/ktime.h~ktime-fix-signed--unsigned-mismatch-in-ktime_to_ns +++ a/include/linux/ktime.h @@ -248,9 +248,9 @@ static inline struct timeval ktime_to_ti * * Returns the scalar nanoseconds representation of kt */ -static inline u64 ktime_to_ns(const ktime_t kt) +static inline s64 ktime_to_ns(const ktime_t kt) { - return (u64) kt.tv.sec * NSEC_PER_SEC + kt.tv.nsec; + return (s64) kt.tv.sec * NSEC_PER_SEC + kt.tv.nsec; } #endif _