Commit cfd18934 authored by Thomas Gleixner's avatar Thomas Gleixner Committed by Linus Torvalds
Browse files

[PATCH] ktime: Fix signed / unsigned mismatch in ktime_to_ns

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: default avatarHelmut Duregger <>
Signed-off-by: default avatarThomas Gleixner <>
Acked-by: default avatarIngo Molnar <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent b46be050
......@@ -248,9 +248,9 @@ static inline struct timeval ktime_to_timeval(const ktime_t kt)
* 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) * NSEC_PER_SEC +;
return (s64) * NSEC_PER_SEC +;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment