i965: Simplify foreach_inst_in_block_safe() macro.
[mesa.git] / 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)