diff options
author | Roman Zippel <zippel@linux-m68k.org> | 2006-03-26 04:38:12 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-26 11:57:03 -0500 |
commit | 05cfb614ddbf3181540ce09d44d96486f8ba8d6a (patch) | |
tree | aafed98638557a4643141d906fbb2406f0764a94 /kernel/posix-timers.c | |
parent | df869b630d9d9131c10cf073fb61646048874b2f (diff) |
[PATCH] hrtimers: remove data field
The nanosleep cleanup allows to remove the data field of hrtimer. The
callback function can use container_of() to get it's own data. Since the
hrtimer structure is anyway embedded in other structures, this adds no
overhead.
Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel/posix-timers.c')
-rw-r--r-- | kernel/posix-timers.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/kernel/posix-timers.c b/kernel/posix-timers.c index 7c5f44787c8c..ac6dc8744429 100644 --- a/kernel/posix-timers.c +++ b/kernel/posix-timers.c | |||
@@ -145,7 +145,7 @@ static int common_timer_set(struct k_itimer *, int, | |||
145 | struct itimerspec *, struct itimerspec *); | 145 | struct itimerspec *, struct itimerspec *); |
146 | static int common_timer_del(struct k_itimer *timer); | 146 | static int common_timer_del(struct k_itimer *timer); |
147 | 147 | ||
148 | static int posix_timer_fn(void *data); | 148 | static int posix_timer_fn(struct hrtimer *data); |
149 | 149 | ||
150 | static struct k_itimer *lock_timer(timer_t timer_id, unsigned long *flags); | 150 | static struct k_itimer *lock_timer(timer_t timer_id, unsigned long *flags); |
151 | 151 | ||
@@ -334,14 +334,14 @@ EXPORT_SYMBOL_GPL(posix_timer_event); | |||
334 | 334 | ||
335 | * This code is for CLOCK_REALTIME* and CLOCK_MONOTONIC* timers. | 335 | * This code is for CLOCK_REALTIME* and CLOCK_MONOTONIC* timers. |
336 | */ | 336 | */ |
337 | static int posix_timer_fn(void *data) | 337 | static int posix_timer_fn(struct hrtimer *timer) |
338 | { | 338 | { |
339 | struct k_itimer *timr = data; | 339 | struct k_itimer *timr; |
340 | struct hrtimer *timer = &timr->it.real.timer; | ||
341 | unsigned long flags; | 340 | unsigned long flags; |
342 | int si_private = 0; | 341 | int si_private = 0; |
343 | int ret = HRTIMER_NORESTART; | 342 | int ret = HRTIMER_NORESTART; |
344 | 343 | ||
344 | timr = container_of(timer, struct k_itimer, it.real.timer); | ||
345 | spin_lock_irqsave(&timr->it_lock, flags); | 345 | spin_lock_irqsave(&timr->it_lock, flags); |
346 | 346 | ||
347 | if (timr->it.real.interval.tv64 != 0) | 347 | if (timr->it.real.interval.tv64 != 0) |
@@ -725,7 +725,6 @@ common_timer_set(struct k_itimer *timr, int flags, | |||
725 | 725 | ||
726 | mode = flags & TIMER_ABSTIME ? HRTIMER_ABS : HRTIMER_REL; | 726 | mode = flags & TIMER_ABSTIME ? HRTIMER_ABS : HRTIMER_REL; |
727 | hrtimer_init(&timr->it.real.timer, timr->it_clock, mode); | 727 | hrtimer_init(&timr->it.real.timer, timr->it_clock, mode); |
728 | timr->it.real.timer.data = timr; | ||
729 | timr->it.real.timer.function = posix_timer_fn; | 728 | timr->it.real.timer.function = posix_timer_fn; |
730 | 729 | ||
731 | timer->expires = timespec_to_ktime(new_setting->it_value); | 730 | timer->expires = timespec_to_ktime(new_setting->it_value); |