Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 234607
b: refs/heads/master
c: 6761c67
h: refs/heads/master
i:
  234605: d6baa60
  234603: a5c8bf8
  234599: ab31f34
  234591: 524915e
v: v3
  • Loading branch information
Thomas Gleixner committed Feb 2, 2011
1 parent e97acde commit 918c432
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a7319fa253a549c4c6528fb550ae6e72a9c83811
refs/heads/master: 6761c6702e2c647582e1829abe8cf90794f61d9d
10 changes: 8 additions & 2 deletions trunk/kernel/posix-timers.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ static __init int init_posix_timers(void)
.timer_create = common_timer_create,
.timer_set = common_timer_set,
.timer_get = common_timer_get,
.timer_del = common_timer_del,
};
struct k_clock clock_monotonic = {
.clock_getres = hrtimer_get_res,
Expand All @@ -263,6 +264,7 @@ static __init int init_posix_timers(void)
.timer_create = common_timer_create,
.timer_set = common_timer_set,
.timer_get = common_timer_get,
.timer_del = common_timer_del,
};
struct k_clock clock_monotonic_raw = {
.clock_getres = hrtimer_get_res,
Expand Down Expand Up @@ -859,7 +861,7 @@ SYSCALL_DEFINE4(timer_settime, timer_t, timer_id, int, flags,
return error;
}

static inline int common_timer_del(struct k_itimer *timer)
static int common_timer_del(struct k_itimer *timer)
{
timer->it.real.interval.tv64 = 0;

Expand All @@ -870,7 +872,11 @@ static inline int common_timer_del(struct k_itimer *timer)

static inline int timer_delete_hook(struct k_itimer *timer)
{
return CLOCK_DISPATCH(timer->it_clock, timer_del, (timer));
struct k_clock *kc = clockid_to_kclock(timer->it_clock);

if (WARN_ON_ONCE(!kc || !kc->timer_del))
return -EINVAL;
return kc->timer_del(timer);
}

/* Delete a POSIX.1b interval timer. */
Expand Down

0 comments on commit 918c432

Please sign in to comment.