mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
[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 <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
df869b630d
commit
05cfb614dd
8 changed files with 22 additions and 27 deletions
|
|
@ -145,7 +145,7 @@ static int common_timer_set(struct k_itimer *, int,
|
|||
struct itimerspec *, struct itimerspec *);
|
||||
static int common_timer_del(struct k_itimer *timer);
|
||||
|
||||
static int posix_timer_fn(void *data);
|
||||
static int posix_timer_fn(struct hrtimer *data);
|
||||
|
||||
static struct k_itimer *lock_timer(timer_t timer_id, unsigned long *flags);
|
||||
|
||||
|
|
@ -334,14 +334,14 @@ EXPORT_SYMBOL_GPL(posix_timer_event);
|
|||
|
||||
* This code is for CLOCK_REALTIME* and CLOCK_MONOTONIC* timers.
|
||||
*/
|
||||
static int posix_timer_fn(void *data)
|
||||
static int posix_timer_fn(struct hrtimer *timer)
|
||||
{
|
||||
struct k_itimer *timr = data;
|
||||
struct hrtimer *timer = &timr->it.real.timer;
|
||||
struct k_itimer *timr;
|
||||
unsigned long flags;
|
||||
int si_private = 0;
|
||||
int ret = HRTIMER_NORESTART;
|
||||
|
||||
timr = container_of(timer, struct k_itimer, it.real.timer);
|
||||
spin_lock_irqsave(&timr->it_lock, flags);
|
||||
|
||||
if (timr->it.real.interval.tv64 != 0)
|
||||
|
|
@ -725,7 +725,6 @@ common_timer_set(struct k_itimer *timr, int flags,
|
|||
|
||||
mode = flags & TIMER_ABSTIME ? HRTIMER_ABS : HRTIMER_REL;
|
||||
hrtimer_init(&timr->it.real.timer, timr->it_clock, mode);
|
||||
timr->it.real.timer.data = timr;
|
||||
timr->it.real.timer.function = posix_timer_fn;
|
||||
|
||||
timer->expires = timespec_to_ktime(new_setting->it_value);
|
||||
|
|
|
|||
Loading…
Reference in a new issue