From: Joel Fernandes <joelagnelf@nvidia.com>
To: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
Cc: Miguel Ojeda <ojeda@kernel.org>,
Danilo Krummrich <dakr@kernel.org>,
linux-kernel@vger.kernel.org, Boqun Feng <boqun@kernel.org>,
Gary Guo <gary@garyguo.net>,
Alexandre Courbot <acourbot@nvidia.com>,
rust-for-linux@vger.kernel.org, dri-devel@lists.freedesktop.org,
nouveau@lists.freedesktop.org
Subject: Re: [PATCH v12 1/1] rust: interop: Add list module for C linked list interface
Date: Mon, 16 Mar 2026 14:47:36 -0400 [thread overview]
Message-ID: <b9ac5703-7298-430c-9f8d-e358455d73c8@nvidia.com> (raw)
In-Reply-To: <CANiq72m2Eo1UAuwMC0LhiD4+yqKixRm=+oHtEnpwY-VbNdR+fw@mail.gmail.com>
On Thu, 12 Mar 2026 20:16:00 +0100, Miguel Ojeda wrote:
>> Acked-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
>
> Acked-by: Miguel Ojeda <ojeda@kernel.org>
Thanks, will change to this.
>> +//! # // SAFETY: head and all the items are test objects allocated in this scope.
>
> `head`
Fixed.
>> +//! // Rust wrapper for the C struct.
>
> Empty newline comment between these:
>
> //! //
>
> Actually, should this be `//! ///`?
>
>> +//! // The list item struct in this example is defined in C code as:
>> +//! // struct SampleItemC {
>> +//! // int value;
>> +//! // struct list_head link;
>> +//! // };
>> +//! //
>
> Let's try to use the usual style, i.e. no empty newline at the end of
> docs for an item.
>
> And the example should be in a proper code block with a C tag, so all
> together something like:
>
> //! /// Rust wrapper for the C struct.
> //! ///
> //! /// The list item struct in this example is defined in C code as:
> //! ///
> //! /// ```c
> //! /// struct SampleItemC {
> //! /// int value;
> //! /// struct list_head link;
> //! /// };
> //! /// ```
Fixed.
>> +//! // SAFETY: [`Item`] has same layout as [`SampleItemC`].
>
> No need for intra-doc links in comments (for now at least).
Fixed.
>> +//! // Create typed [`CList`] from sentinel head.
>
> Empty newline comment.
Fixed.
>> +//! // SAFETY: head is valid and initialized, items are `SampleItemC` with
>
> `head`
>
> However, this is giving me a Clippy issue (please see the other email).
Fixed.
>> +/// `next`/`prev` pointers are valid and non-NULL.
>
> We started using `NULL` recently as a convention for the null pointer.
Fixed.
>> + // - [`CListHead`] has same layout as `list_head`.
>
> Intra-doc link not needed.
Fixed.
>> + // - `ptr` is valid and unmodified for 'a per caller guarantees.
>
> `'a`
Fixed.
>> + // SAFETY: self.as_raw() is valid per type invariants.
>
> `self.as_raw()`
Fixed.
>> +/// perform conversion of returned [`CListHead`] to an item (using `container_of` macro or similar).
>
> Intra-doc link to `container_of`?
Added.
>> + // - [`CList`] has same layout as [`CListHead`] due to repr(transparent).
>
> Intra-doc link not needed.
>> + // Convert to item using OFFSET.
>
> `OFFSET`
>
> Newline comment after this one.
>> +/// Create a C doubly-circular linked list interface `CList` from a raw `list_head` pointer.
>
> [`CList`]
>> +/// pointing to a list that is not concurrently modified for the lifetime of the `CList`.
>
> [`CList`]
Fixed all these.
>> +/// Refer to the examples in this module's documentation.
>
> Perhaps we could have an intra-doc link here to the module.
Added.
>> + // Compile-time check that field path is a list_head.
>
> `list_head`
Fixed.
Thanks for the thorough review!
--
Joel Fernandes
next prev parent reply other threads:[~2026-03-16 18:47 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-06 20:36 [PATCH v12 0/1] rust: interop: Add list module for C linked list interface Joel Fernandes
2026-03-06 20:36 ` [PATCH v12 1/1] " Joel Fernandes
2026-03-12 17:42 ` Danilo Krummrich
2026-03-12 19:15 ` Miguel Ojeda
2026-03-12 19:16 ` Miguel Ojeda
2026-03-16 18:47 ` Joel Fernandes [this message]
2026-03-12 19:20 ` Miguel Ojeda
2026-03-12 19:50 ` Danilo Krummrich
2026-03-16 17:57 ` Joel Fernandes
2026-03-16 22:24 ` Nova developers: avoid nouveau mailing list until it is fixed John Hubbard
2026-03-16 22:25 ` John Hubbard
2026-03-16 22:36 ` Danilo Krummrich
2026-03-16 22:37 ` John Hubbard
2026-03-16 18:54 ` [PATCH v12 1/1] rust: interop: Add list module for C linked list interface Joel Fernandes
2026-03-16 4:34 ` Alexandre Courbot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b9ac5703-7298-430c-9f8d-e358455d73c8@nvidia.com \
--to=joelagnelf@nvidia.com \
--cc=acourbot@nvidia.com \
--cc=boqun@kernel.org \
--cc=dakr@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=gary@garyguo.net \
--cc=linux-kernel@vger.kernel.org \
--cc=miguel.ojeda.sandonis@gmail.com \
--cc=nouveau@lists.freedesktop.org \
--cc=ojeda@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox