Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 289071
b: refs/heads/master
c: 66c4810
h: refs/heads/master
i:
  289069: 8188f6f
  289067: f9ea09b
  289063: 8190693
  289055: 0c25071
v: v3
  • Loading branch information
Arve Hjønnevåg authored and Greg Kroah-Hartman committed Feb 10, 2012
1 parent 2a0d1eb commit 4aeb64f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 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: 58a38ff3b12ebd103e3ca2c5dea3292ffbfd0f02
refs/heads/master: 66c48107719b751e8ec360034bc84ee1511147e4
11 changes: 7 additions & 4 deletions trunk/drivers/staging/android/alarm.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,15 @@ static void alarm_enqueue_locked(struct android_alarm *alarm)
struct rb_node *parent = NULL;
struct android_alarm *entry;
int leftmost = 1;
bool was_first = false;

pr_alarm(FLOW, "added alarm, type %d, func %pF at %lld\n",
alarm->type, alarm->function, ktime_to_ns(alarm->expires));

if (base->first == &alarm->node)
if (base->first == &alarm->node) {
base->first = rb_next(&alarm->node);
was_first = true;
}
if (!RB_EMPTY_NODE(&alarm->node)) {
rb_erase(&alarm->node, &base->alarms);
RB_CLEAR_NODE(&alarm->node);
Expand All @@ -144,10 +147,10 @@ static void alarm_enqueue_locked(struct android_alarm *alarm)
leftmost = 0;
}
}
if (leftmost) {
if (leftmost)
base->first = &alarm->node;
update_timer_locked(base, false);
}
if (leftmost || was_first)
update_timer_locked(base, was_first);

rb_link_node(&alarm->node, parent, link);
rb_insert_color(&alarm->node, &base->alarms);
Expand Down

0 comments on commit 4aeb64f

Please sign in to comment.