* [PATCH 02/12] hrtimer: fix multiple macro argument expansion
@ 2006-02-14 10:10 Roman Zippel
2006-02-14 21:54 ` Thomas Gleixner
0 siblings, 1 reply; 2+ messages in thread
From: Roman Zippel @ 2006-02-14 10:10 UTC (permalink / raw)
To: Andrew Morton, linux-kernel, tglx, mingo
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>
---
include/linux/ktime.h | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
Index: linux-2.6-git/include/linux/ktime.h
===================================================================
--- linux-2.6-git.orig/include/linux/ktime.h 2006-02-14 04:56:22.000000000 +0100
+++ linux-2.6-git/include/linux/ktime.h 2006-02-14 04:56:26.000000000 +0100
@@ -96,10 +96,16 @@ static inline ktime_t ktime_set(const lo
({ (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)
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH 02/12] hrtimer: fix multiple macro argument expansion
2006-02-14 10:10 [PATCH 02/12] hrtimer: fix multiple macro argument expansion Roman Zippel
@ 2006-02-14 21:54 ` Thomas Gleixner
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Gleixner @ 2006-02-14 21:54 UTC (permalink / raw)
To: Roman Zippel; +Cc: Andrew Morton, linux-kernel, mingo
On Tue, 2006-02-14 at 11:10 +0100, Roman Zippel wrote:
> 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>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-02-14 21:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-02-14 10:10 [PATCH 02/12] hrtimer: fix multiple macro argument expansion Roman Zippel
2006-02-14 21:54 ` Thomas Gleixner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®