Danilo Krummrich
2025-Oct-30 21:15 UTC
[PATCH RFC 2/4] samples: rust: Add sample demonstrating C linked list iteration
On Thu Oct 30, 2025 at 8:06 PM CET, Joel Fernandes wrote:> Demonstrates usage of the clist module for iterating over > C-managed linked lists. C code creates and populates the list, > Rust code performs safe iteration using the clist abstraction.I don't think a sample module is the correct choice for this. It makes it look a bit like this is an API intended for drivers. I think kunit tests might be a better fit.
Joel Fernandes
2025-Oct-30 22:09 UTC
[PATCH RFC 2/4] samples: rust: Add sample demonstrating C linked list iteration
On 10/30/2025 5:15 PM, Danilo Krummrich wrote:> On Thu Oct 30, 2025 at 8:06 PM CET, Joel Fernandes wrote: >> Demonstrates usage of the clist module for iterating over >> C-managed linked lists. C code creates and populates the list, >> Rust code performs safe iteration using the clist abstraction. > > I don't think a sample module is the correct choice for this. It makes it look a > bit like this is an API intended for drivers. I think kunit tests might be a > better fit.Sure, kunit tests indeed sound better. I will convert it over (this and the other one). Thanks! - Joel
Alexandre Courbot
2025-Nov-01 03:52 UTC
[PATCH RFC 2/4] samples: rust: Add sample demonstrating C linked list iteration
On Fri Oct 31, 2025 at 6:15 AM JST, Danilo Krummrich wrote:> On Thu Oct 30, 2025 at 8:06 PM CET, Joel Fernandes wrote: >> Demonstrates usage of the clist module for iterating over >> C-managed linked lists. C code creates and populates the list, >> Rust code performs safe iteration using the clist abstraction. > > I don't think a sample module is the correct choice for this. It makes it look a > bit like this is an API intended for drivers. I think kunit tests might be a > better fit.Yup, we can probably move this into the doctest examples and have them serve as examples as well.