diff options
author | YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> | 2007-04-24 19:21:38 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-04-26 01:29:49 -0400 |
commit | 84299b3bc4eaedc0734fcc9052b01291e44445fc (patch) | |
tree | a66254a9d648ec93334abbb058a376e7482e80d5 /include/linux/ktime.h | |
parent | 1f9eda7e2b67898fb8e79b3aa3880211b51235e6 (diff) |
[TCP]: Fix linkage errors on i386.
To avoid raw division, use ktime_to_timeval() to get usec.
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/ktime.h')
-rw-r--r-- | include/linux/ktime.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/ktime.h b/include/linux/ktime.h index 248305bb9a18..81bb9c7a4eb3 100644 --- a/include/linux/ktime.h +++ b/include/linux/ktime.h | |||
@@ -259,6 +259,12 @@ static inline s64 ktime_to_ns(const ktime_t kt) | |||
259 | 259 | ||
260 | #endif | 260 | #endif |
261 | 261 | ||
262 | static inline s64 ktime_to_us(const ktime_t kt) | ||
263 | { | ||
264 | struct timeval tv = ktime_to_timeval(kt); | ||
265 | return (s64) tv.tv_sec * USEC_PER_SEC + tv.tv_usec; | ||
266 | } | ||
267 | |||
262 | /* | 268 | /* |
263 | * The resolution of the clocks. The resolution value is returned in | 269 | * The resolution of the clocks. The resolution value is returned in |
264 | * the clock_getres() system call to give application programmers an | 270 | * the clock_getres() system call to give application programmers an |