i965: Simplify foreach_inst_in_block_safe() macro.
authorMatt Turner <mattst88@gmail.com>
Thu, 26 May 2016 19:09:33 +0000 (12:09 -0700)
committerMatt Turner <mattst88@gmail.com>
Thu, 30 Jun 2016 18:08:39 +0000 (11:08 -0700)
We know what the end looks like without examining .tail: it's NULL. It's
always NULL.

src/mesa/drivers/dri/i965/brw_cfg.h

index 5b770aa7af121c6f08308c13aa169d9b21d9cd22..1c90eab5ebae2be77cbcd09fccf4d434d8b7e14e 100644 (file)
@@ -334,9 +334,8 @@ struct cfg_t {
 
 #define foreach_inst_in_block_safe(__type, __inst, __block)    \
    for (__type *__inst = (__type *)__block->instructions.head, \
-               *__next = (__type *)__inst->next,               \
-               *__end = (__type *)__block->instructions.tail;  \
-        __next != __end;                                       \
+               *__next = (__type *)__inst->next;               \
+        __next != NULL;                                        \
         __inst = __next,                                       \
         __next = (__type *)__next->next)