diff options
author | Jeff Garzik <jgarzik@pobox.com> | 2006-02-20 02:16:23 -0500 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2006-02-20 02:16:23 -0500 |
commit | 5b2ffed906a3ebd4e52a5bbef06b99a517c53e4b (patch) | |
tree | 2f900f89d93db6b0822d8bdf4f49851c581c12a6 /include/linux/ktime.h | |
parent | f1b318793dcd2d9ff6b5ac06e7762098fa079cee (diff) | |
parent | bd71c2b17468a2531fb4c81ec1d73520845e97e1 (diff) |
Merge branch 'master'
Diffstat (limited to 'include/linux/ktime.h')
-rw-r--r-- | include/linux/ktime.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/include/linux/ktime.h b/include/linux/ktime.h index 6aca67a569a..f3dec45ef87 100644 --- a/include/linux/ktime.h +++ b/include/linux/ktime.h @@ -96,10 +96,16 @@ static inline ktime_t ktime_set(const long secs, const unsigned long nsecs) ({ (ktime_t){ .tv64 = (kt).tv64 + (nsval) }; }) /* convert a timespec to ktime_t format: */ -#define timespec_to_ktime(ts) ktime_set((ts).tv_sec, (ts).tv_nsec) +static inline ktime_t timespec_to_ktime(struct timespec ts) +{ + return ktime_set(ts.tv_sec, ts.tv_nsec); +} /* convert a timeval to ktime_t format: */ -#define timeval_to_ktime(tv) ktime_set((tv).tv_sec, (tv).tv_usec * 1000) +static inline ktime_t timeval_to_ktime(struct timeval tv) +{ + return ktime_set(tv.tv_sec, tv.tv_usec * NSEC_PER_USEC); +} /* Map the ktime_t to timespec conversion to ns_to_timespec function */ #define ktime_to_timespec(kt) ns_to_timespec((kt).tv64) |