[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <93114f3c-c1d9-48f5-ad76-f74d4d53c9e0@nvidia.com>
Date: Thu, 27 Nov 2025 00:08:52 -0500
From: Joel Fernandes <joelagnelf@...dia.com>
To: Alexandre Courbot <acourbot@...dia.com>
Cc: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"rust-for-linux@...r.kernel.org" <rust-for-linux@...r.kernel.org>,
"dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>,
"dakr@...nel.org" <dakr@...nel.org>, "airlied@...il.com"
<airlied@...il.com>, Alistair Popple <apopple@...dia.com>,
"ojeda@...nel.org" <ojeda@...nel.org>,
"alex.gaynor@...il.com" <alex.gaynor@...il.com>,
"boqun.feng@...il.com" <boqun.feng@...il.com>,
"gary@...yguo.net" <gary@...yguo.net>,
"bjorn3_gh@...tonmail.com" <bjorn3_gh@...tonmail.com>,
"lossin@...nel.org" <lossin@...nel.org>,
"a.hindborg@...nel.org" <a.hindborg@...nel.org>,
"aliceryhl@...gle.com" <aliceryhl@...gle.com>,
"tmgross@...ch.edu" <tmgross@...ch.edu>, "simona@...ll.ch"
<simona@...ll.ch>,
"maarten.lankhorst@...ux.intel.com" <maarten.lankhorst@...ux.intel.com>,
"mripard@...nel.org" <mripard@...nel.org>,
"tzimmermann@...e.de" <tzimmermann@...e.de>,
John Hubbard <jhubbard@...dia.com>, Timur Tabi <ttabi@...dia.com>,
"joel@...lfernandes.org" <joel@...lfernandes.org>,
"elle@...thered-steel.dev" <elle@...thered-steel.dev>,
"daniel.almeida@...labora.com" <daniel.almeida@...labora.com>,
Andrea Righi <arighi@...dia.com>, "phasta@...nel.org" <phasta@...nel.org>,
"nouveau@...ts.freedesktop.org" <nouveau@...ts.freedesktop.org>,
Nouveau <nouveau-bounces@...ts.freedesktop.org>
Subject: Re: [PATCH v2 3/3] rust: clist: Add typed iteration with FromListHead
trait
>>>>> Also as I suspected in v1 `Clist` appears to do very little apart from
>>>>> providing an iterator, so I'm more convinced that the front type for
>>>>> this should be `ClistHead`.
>>>>
>>>> This part I don't agree with. I prefer to keep it as `Clist` which wraps a
>>>> sentinel list head. A random `ClistHead` is not necessarily a sentinel.
>>>
>>> I expressed myself poorly - what I meant of that `ClistHead` should be
>>> the only type you need for the low-level iteration (which should not be
>>> public).
>>
>> For low level iteration it is already via that type. There are 2 iterators. The higher level uses the lower level one. I could make it even simpler and collapse bother iterators into one - that yields the final type T.
>
> I think the current 2 iterators design is elegant: the lower-level one
> taking care of going through the list, and the higher-level one building
> on top of that and adding upcasting. Maybe the lower-level one can be
> made private, but I'd keep it in any case.
>
Yeah, I kept it split for that purpose but had a nagging feeling if it was
required. But ok, I will leave that part alone then. Making it private sgtm.
Thanks.
Powered by blists - more mailing lists