summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2016-03-15 18:50:32 -0700
committerEric Anholt <[email protected]>2016-03-16 11:28:34 -0700
commita298fb15afa91d866c78f80fbd71bafeb9f36fda (patch)
tree57f10159047d0479f875576f403de6722d5019c6 /src/gallium
parentb566317e7e6eb78a22cac759a4af2e9d78f74a32 (diff)
vc4: Reuse list_for_each_entry_safe_rev().
This didn't exist when I wrote the code.
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/vc4/vc4_opt_dead_code.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/gallium/drivers/vc4/vc4_opt_dead_code.c b/src/gallium/drivers/vc4/vc4_opt_dead_code.c
index 9e79a2d1b2e..44d0779c611 100644
--- a/src/gallium/drivers/vc4/vc4_opt_dead_code.c
+++ b/src/gallium/drivers/vc4/vc4_opt_dead_code.c
@@ -86,12 +86,8 @@ qir_opt_dead_code(struct vc4_compile *c)
/* Whether we're eliminating texture setup currently. */
bool dce_tex = false;
- struct list_head *node, *t;
- for (node = c->instructions.prev, t = node->prev;
- &c->instructions != node;
- node = t, t = t->prev) {
- struct qinst *inst = (struct qinst *)node;
-
+ list_for_each_entry_safe_rev(struct qinst, inst, &c->instructions,
+ link) {
if (inst->dst.file == QFILE_TEMP &&
!used[inst->dst.index] &&
!inst->sf &&