Re: [Mesa-dev] [PATCH 1/2] util: Fix foreach_list_typed_safe when exec_node is not at offset 0.

2015-03-10 Thread Matt Turner
On Mon, Mar 9, 2015 at 6:36 PM, Kenneth Graunke kenn...@whitecape.org wrote: From: Jason Ekstrand jason.ekstr...@intel.com __next and __prev are pointers to the structure containing the exec_node link, not the embedded exec_node. NULL checks would fail unless the embedded exec_node happened

Re: [Mesa-dev] [PATCH 1/2] util: Fix foreach_list_typed_safe when exec_node is not at offset 0.

2015-03-10 Thread Matt Turner
On Tue, Mar 10, 2015 at 1:09 PM, Jason Ekstrand ja...@jlekstrand.net wrote: How about we do things slightly differently and check (__node)-field.next != NULL just like we do on regular versions. Since the check happens between the increment step and running the user's code, __node is valid for

Re: [Mesa-dev] [PATCH 1/2] util: Fix foreach_list_typed_safe when exec_node is not at offset 0.

2015-03-10 Thread Ian Romanick
On 03/09/2015 06:36 PM, Kenneth Graunke wrote: From: Jason Ekstrand jason.ekstr...@intel.com __next and __prev are pointers to the structure containing the exec_node link, not the embedded exec_node. NULL checks would fail unless the embedded exec_node happened to be at offset 0 in the

Re: [Mesa-dev] [PATCH 1/2] util: Fix foreach_list_typed_safe when exec_node is not at offset 0.

2015-03-10 Thread Connor Abbott
On Tue, Mar 10, 2015 at 10:54 PM, Ian Romanick i...@freedesktop.org wrote: On 03/09/2015 06:36 PM, Kenneth Graunke wrote: From: Jason Ekstrand jason.ekstr...@intel.com __next and __prev are pointers to the structure containing the exec_node link, not the embedded exec_node. NULL checks would

Re: [Mesa-dev] [PATCH 1/2] util: Fix foreach_list_typed_safe when exec_node is not at offset 0.

2015-03-10 Thread Matt Turner
On Tue, Mar 10, 2015 at 8:31 PM, Ian Romanick i...@freedesktop.org wrote: Also... I'm not a fan of these ever-growing macros. They're a lot like alligators. They're pretty cute when they're small, but when they grow up they drown you in a river and eat you. I feel like the users of this

Re: [Mesa-dev] [PATCH 1/2] util: Fix foreach_list_typed_safe when exec_node is not at offset 0.

2015-03-10 Thread Ian Romanick
On 03/10/2015 08:04 PM, Connor Abbott wrote: On Tue, Mar 10, 2015 at 10:54 PM, Ian Romanick i...@freedesktop.org wrote: On 03/09/2015 06:36 PM, Kenneth Graunke wrote: From: Jason Ekstrand jason.ekstr...@intel.com __next and __prev are pointers to the structure containing the exec_node link,

Re: [Mesa-dev] [PATCH 1/2] util: Fix foreach_list_typed_safe when exec_node is not at offset 0.

2015-03-10 Thread Kenneth Graunke
On Tuesday, March 10, 2015 05:48:20 PM Jason Ekstrand wrote: On Tue, Mar 10, 2015 at 5:45 PM, Matt Turner matts...@gmail.com wrote: On Tue, Mar 10, 2015 at 1:09 PM, Jason Ekstrand ja...@jlekstrand.net wrote: How about we do things slightly differently and check (__node)-field.next

Re: [Mesa-dev] [PATCH 1/2] util: Fix foreach_list_typed_safe when exec_node is not at offset 0.

2015-03-10 Thread Jason Ekstrand
On Tue, Mar 10, 2015 at 5:45 PM, Matt Turner matts...@gmail.com wrote: On Tue, Mar 10, 2015 at 1:09 PM, Jason Ekstrand ja...@jlekstrand.net wrote: How about we do things slightly differently and check (__node)-field.next != NULL just like we do on regular versions. Since the check happens

Re: [Mesa-dev] [PATCH 1/2] util: Fix foreach_list_typed_safe when exec_node is not at offset 0.

2015-03-10 Thread Jason Ekstrand
On Mon, Mar 9, 2015 at 11:06 PM, Matt Turner matts...@gmail.com wrote: On Mon, Mar 9, 2015 at 6:36 PM, Kenneth Graunke kenn...@whitecape.org wrote: From: Jason Ekstrand jason.ekstr...@intel.com __next and __prev are pointers to the structure containing the exec_node link, not the

Re: [Mesa-dev] [PATCH 1/2] util: Fix foreach_list_typed_safe when exec_node is not at offset 0.

2015-03-09 Thread Connor Abbott
Reviewed-by: Connor Abbott cwabbo...@gmail.com On Mon, Mar 9, 2015 at 9:36 PM, Kenneth Graunke kenn...@whitecape.org wrote: From: Jason Ekstrand jason.ekstr...@intel.com __next and __prev are pointers to the structure containing the exec_node link, not the embedded exec_node. NULL checks

Re: [Mesa-dev] [PATCH 1/2] util: Fix foreach_list_typed_safe when exec_node is not at offset 0.

2015-03-09 Thread Matt Turner
On Mon, Mar 9, 2015 at 7:24 PM, Matt Turner matts...@gmail.com wrote: On Mon, Mar 9, 2015 at 6:36 PM, Kenneth Graunke kenn...@whitecape.org wrote: From: Jason Ekstrand jason.ekstr...@intel.com __next and __prev are pointers to the structure containing the exec_node link, not the embedded

Re: [Mesa-dev] [PATCH 1/2] util: Fix foreach_list_typed_safe when exec_node is not at offset 0.

2015-03-09 Thread Jason Ekstrand
On Mon, Mar 9, 2015 at 7:58 PM, Matt Turner matts...@gmail.com wrote: On Mon, Mar 9, 2015 at 7:32 PM, Jason Ekstrand ja...@jlekstrand.net wrote: On Mon, Mar 9, 2015 at 7:24 PM, Matt Turner matts...@gmail.com wrote: On Mon, Mar 9, 2015 at 6:36 PM, Kenneth Graunke kenn...@whitecape.org

[Mesa-dev] [PATCH 1/2] util: Fix foreach_list_typed_safe when exec_node is not at offset 0.

2015-03-09 Thread Kenneth Graunke
From: Jason Ekstrand jason.ekstr...@intel.com __next and __prev are pointers to the structure containing the exec_node link, not the embedded exec_node. NULL checks would fail unless the embedded exec_node happened to be at offset 0 in the parent struct. Signed-off-by: Jason Ekstrand

Re: [Mesa-dev] [PATCH 1/2] util: Fix foreach_list_typed_safe when exec_node is not at offset 0.

2015-03-09 Thread Matt Turner
On Mon, Mar 9, 2015 at 6:36 PM, Kenneth Graunke kenn...@whitecape.org wrote: From: Jason Ekstrand jason.ekstr...@intel.com __next and __prev are pointers to the structure containing the exec_node link, not the embedded exec_node. NULL checks would fail unless the embedded exec_node happened

Re: [Mesa-dev] [PATCH 1/2] util: Fix foreach_list_typed_safe when exec_node is not at offset 0.

2015-03-09 Thread Jason Ekstrand
On Mon, Mar 9, 2015 at 7:24 PM, Matt Turner matts...@gmail.com wrote: On Mon, Mar 9, 2015 at 6:36 PM, Kenneth Graunke kenn...@whitecape.org wrote: From: Jason Ekstrand jason.ekstr...@intel.com __next and __prev are pointers to the structure containing the exec_node link, not the

Re: [Mesa-dev] [PATCH 1/2] util: Fix foreach_list_typed_safe when exec_node is not at offset 0.

2015-03-09 Thread Jason Ekstrand
On Mon, Mar 9, 2015 at 7:48 PM, Connor Abbott cwabbo...@gmail.com wrote: On Mon, Mar 9, 2015 at 10:35 PM, Matt Turner matts...@gmail.com wrote: On Mon, Mar 9, 2015 at 7:24 PM, Matt Turner matts...@gmail.com wrote: On Mon, Mar 9, 2015 at 6:36 PM, Kenneth Graunke kenn...@whitecape.org wrote:

Re: [Mesa-dev] [PATCH 1/2] util: Fix foreach_list_typed_safe when exec_node is not at offset 0.

2015-03-09 Thread Connor Abbott
On Mon, Mar 9, 2015 at 11:02 PM, Jason Ekstrand ja...@jlekstrand.net wrote: On Mon, Mar 9, 2015 at 7:59 PM, Connor Abbott cwabbo...@gmail.com wrote: On Mon, Mar 9, 2015 at 10:54 PM, Jason Ekstrand ja...@jlekstrand.net wrote: On Mon, Mar 9, 2015 at 7:48 PM, Connor Abbott

Re: [Mesa-dev] [PATCH 1/2] util: Fix foreach_list_typed_safe when exec_node is not at offset 0.

2015-03-09 Thread Connor Abbott
On Mon, Mar 9, 2015 at 10:35 PM, Matt Turner matts...@gmail.com wrote: On Mon, Mar 9, 2015 at 7:24 PM, Matt Turner matts...@gmail.com wrote: On Mon, Mar 9, 2015 at 6:36 PM, Kenneth Graunke kenn...@whitecape.org wrote: From: Jason Ekstrand jason.ekstr...@intel.com __next and __prev are

Re: [Mesa-dev] [PATCH 1/2] util: Fix foreach_list_typed_safe when exec_node is not at offset 0.

2015-03-09 Thread Matt Turner
On Mon, Mar 9, 2015 at 7:32 PM, Jason Ekstrand ja...@jlekstrand.net wrote: On Mon, Mar 9, 2015 at 7:24 PM, Matt Turner matts...@gmail.com wrote: On Mon, Mar 9, 2015 at 6:36 PM, Kenneth Graunke kenn...@whitecape.org wrote: From: Jason Ekstrand jason.ekstr...@intel.com __next and __prev

Re: [Mesa-dev] [PATCH 1/2] util: Fix foreach_list_typed_safe when exec_node is not at offset 0.

2015-03-09 Thread Connor Abbott
On Mon, Mar 9, 2015 at 10:54 PM, Jason Ekstrand ja...@jlekstrand.net wrote: On Mon, Mar 9, 2015 at 7:48 PM, Connor Abbott cwabbo...@gmail.com wrote: On Mon, Mar 9, 2015 at 10:35 PM, Matt Turner matts...@gmail.com wrote: On Mon, Mar 9, 2015 at 7:24 PM, Matt Turner matts...@gmail.com wrote:

Re: [Mesa-dev] [PATCH 1/2] util: Fix foreach_list_typed_safe when exec_node is not at offset 0.

2015-03-09 Thread Jason Ekstrand
On Mon, Mar 9, 2015 at 7:59 PM, Connor Abbott cwabbo...@gmail.com wrote: On Mon, Mar 9, 2015 at 10:54 PM, Jason Ekstrand ja...@jlekstrand.net wrote: On Mon, Mar 9, 2015 at 7:48 PM, Connor Abbott cwabbo...@gmail.com wrote: On Mon, Mar 9, 2015 at 10:35 PM, Matt Turner