From: Eric Anholt Date: Thu, 28 Feb 2019 19:02:25 +0000 (-0800) Subject: vc4: Reuse list_for_each_entry_rev(). X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d6d83b34ee3486d2154c1c929900d329448cb6c0;p=mesa.git vc4: Reuse list_for_each_entry_rev(). --- diff --git a/src/gallium/drivers/vc4/vc4_qpu_schedule.c b/src/gallium/drivers/vc4/vc4_qpu_schedule.c index 9141396c872..7bd3e179539 100644 --- a/src/gallium/drivers/vc4/vc4_qpu_schedule.c +++ b/src/gallium/drivers/vc4/vc4_qpu_schedule.c @@ -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); } }