[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <fa47b9fb-00d6-40e1-9445-e9d2bc9f23da@nvidia.com>
Date: Tue, 25 Nov 2025 18:06:34 -0500
From: Joel Fernandes <joelagnelf@...dia.com>
To: Alexandre Courbot <acourbot@...dia.com>, linux-kernel@...r.kernel.org,
rust-for-linux@...r.kernel.org, dri-devel@...ts.freedesktop.org,
dakr@...nel.org, airlied@...il.com
Cc: apopple@...dia.com, ojeda@...nel.org, alex.gaynor@...il.com,
boqun.feng@...il.com, gary@...yguo.net, bjorn3_gh@...tonmail.com,
lossin@...nel.org, a.hindborg@...nel.org, aliceryhl@...gle.com,
tmgross@...ch.edu, simona@...ll.ch, maarten.lankhorst@...ux.intel.com,
mripard@...nel.org, tzimmermann@...e.de, jhubbard@...dia.com,
ttabi@...dia.com, joel@...lfernandes.org, elle@...thered-steel.dev,
daniel.almeida@...labora.com, arighi@...dia.com, phasta@...nel.org,
nouveau@...ts.freedesktop.org,
Nouveau <nouveau-bounces@...ts.freedesktop.org>
Subject: Re: [PATCH v2 2/3] rust: clist: Add basic list infrastructure and
head iterator
On 11/23/2025 10:47 PM, Alexandre Courbot wrote:
>> +}
>> +
>> +/// Low-level iterator over `list_head` nodes.
>> +///
>> +/// An iterator used to iterate over a C intrusive linked list (`list_head`). Caller has to
>> +/// perform conversion of returned `ClistHead` to an item (typically using `container_of` macro).
>> +///
>> +/// # Invariants
>> +///
>> +/// `ClistHeadIter` is iterating over an allocated, initialized and valid `Clist`.
>> +pub struct ClistHeadIter<'a> {
>> + current: &'a ClistHead,
>> + head: &'a ClistHead,
>
> IIUC `head` should probably be a `Clist`?
Sure, but then I would rename it from 'head' to 'list' then, if that's Ok.
The iterator holds the list, and the current position, which makes sense to me.
thanks,
- Joel
- Joel
Powered by blists - more mailing lists