Re: [PATCH drm-next v2 03/16] maple_tree: split up MA_STATE() macro

2023-02-21 Thread Liam R. Howlett
* Danilo Krummrich [230220 09:38]: > On 2/17/23 19:34, Liam R. Howlett wrote: > > * Danilo Krummrich [230217 08:44]: > > > Split up the MA_STATE() macro such that components using the maple tree > > > can easily inherit from struct ma_state and build custom tree walk > > > macros to hide their in

Re: [PATCH drm-next v2 03/16] maple_tree: split up MA_STATE() macro

2023-02-20 Thread Danilo Krummrich
On 2/17/23 19:34, Liam R. Howlett wrote: * Danilo Krummrich [230217 08:44]: Split up the MA_STATE() macro such that components using the maple tree can easily inherit from struct ma_state and build custom tree walk macros to hide their internals from users. Example: struct sample_iter {

Re: [PATCH drm-next v2 03/16] maple_tree: split up MA_STATE() macro

2023-02-20 Thread Danilo Krummrich
On 2/17/23 20:45, Matthew Wilcox wrote: On Fri, Feb 17, 2023 at 02:44:09PM +0100, Danilo Krummrich wrote: \#define SAMPLE_ITER(name, __mgr) \ struct sample_iter name = { \ .mas = __MA_STATE(&(__mgr)->mt, 0, 0), This is usually called MA_STATE_INIT() Yep, that's better

Re: [PATCH drm-next v2 03/16] maple_tree: split up MA_STATE() macro

2023-02-17 Thread Matthew Wilcox
On Fri, Feb 17, 2023 at 02:44:09PM +0100, Danilo Krummrich wrote: > \#define SAMPLE_ITER(name, __mgr) \ > struct sample_iter name = { \ > .mas = __MA_STATE(&(__mgr)->mt, 0, 0), This is usually called MA_STATE_INIT() > #define sample_iter_for_each_range(it__, start__, end__) \

Re: [PATCH drm-next v2 03/16] maple_tree: split up MA_STATE() macro

2023-02-17 Thread Liam R. Howlett
* Danilo Krummrich [230217 08:44]: > Split up the MA_STATE() macro such that components using the maple tree > can easily inherit from struct ma_state and build custom tree walk > macros to hide their internals from users. > > Example: > > struct sample_iter { > struct ma_state mas; >

[PATCH drm-next v2 03/16] maple_tree: split up MA_STATE() macro

2023-02-17 Thread Danilo Krummrich
Split up the MA_STATE() macro such that components using the maple tree can easily inherit from struct ma_state and build custom tree walk macros to hide their internals from users. Example: struct sample_iter { struct ma_state mas; struct sample_mgr *mgr; struct sample_en