diff options
author | Roman Zippel <zippel@linux-m68k.org> | 2006-02-15 15:17:40 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-02-15 15:32:22 -0800 |
commit | b2ee9dbfad14ba8e34a589d552ddc67300a26bec (patch) | |
tree | 64614faee4f35bb14e3de655f4b276ad14c0ccc5 | |
parent | 5f6164f3092832e0d9b12eed52e09a76bf39c64a (diff) | |
download | op-kernel-dev-b2ee9dbfad14ba8e34a589d552ddc67300a26bec.zip op-kernel-dev-b2ee9dbfad14ba8e34a589d552ddc67300a26bec.tar.gz |
[PATCH] hrtimer: fix multiple macro argument expansion
For two macros the arguments were expanded twice, change them to inline
functions to avoid it.
Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
Acked-by: Ingo Molnar <mingo@elte.hu>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-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 6aca67a..f3dec45 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) |