vc4: Reuse list_for_each_entry_rev().
authorEric Anholt <eric@anholt.net>
Thu, 28 Feb 2019 19:02:25 +0000 (11:02 -0800)
committerEric Anholt <eric@anholt.net>
Mon, 11 Mar 2019 20:14:32 +0000 (13:14 -0700)
src/gallium/drivers/vc4/vc4_qpu_schedule.c

index 9141396c87262013d1093b6ef14ce13c5f760509..7bd3e1795397205e604be180a72e04ac7ceb7112 100644 (file)
@@ -452,13 +452,13 @@ calculate_forward_deps(struct vc4_compile *c, struct list_head *schedule_list)
 static void
 calculate_reverse_deps(struct vc4_compile *c, struct list_head *schedule_list)
 {
-        struct list_head *node;
         struct schedule_state state;
 
         memset(&state, 0, sizeof(state));
         state.dir = R;
 
-        for (node = schedule_list->prev; schedule_list != node; node = node->prev) {
+        list_for_each_entry_rev(struct schedule_node, node, schedule_list,
+                                link) {
                 calculate_deps(&state, (struct schedule_node *)node);
         }
 }