summaryrefslogtreecommitdiff
path: root/os
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2018-04-15 15:40:05 +0100
committerAdam Jackson <ajax@redhat.com>2018-05-21 13:52:13 -0400
commit1e9d5533e3c08fc22099d6dd0f11fa642ab4f1b0 (patch)
treed541ea6cf80332ea2efd9db2abcbf0c834cdd9af /os
parent6115d8b40ce0c91620b6d5e7d18e0da704409f89 (diff)
os/WaitFor: Use the simpler xorg_list_for_each_entry()
As we are not freeing elements while iterating the list of timers, we can forgo using the safe variant, and reduce the number of pointer dances required for the insertion sort. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'os')
-rw-r--r--os/WaitFor.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/os/WaitFor.c b/os/WaitFor.c
index e3b545b93..ae317dc11 100644
--- a/os/WaitFor.c
+++ b/os/WaitFor.c
@@ -295,7 +295,7 @@ OsTimerPtr
TimerSet(OsTimerPtr timer, int flags, CARD32 millis,
OsTimerCallback func, void *arg)
{
- OsTimerPtr existing, tmp;
+ OsTimerPtr existing;
CARD32 now = GetTimeInMillis();
if (!timer) {
@@ -328,7 +328,7 @@ TimerSet(OsTimerPtr timer, int flags, CARD32 millis,
input_lock();
/* Sort into list */
- xorg_list_for_each_entry_safe(existing, tmp, &timers, list)
+ xorg_list_for_each_entry(existing, &timers, list)
if ((int) (existing->expires - millis) > 0)
break;
/* This even works at the end of the list -- existing->list will be timers */