Re: [PATCH v11 1/4] rust: io: add resource abstraction

From: Miguel Ojeda
Date: Wed Jul 02 2025 - 03:45:27 EST


Hi Daniel,

A couple nits Danilo can take care of them on apply.

On Tue, Jul 1, 2025 at 4:35 PM Daniel Almeida
<daniel.almeida@xxxxxxxxxxxxx> wrote:
>
> +//! Abstractions for system resources.

Potential link:

https://docs.kernel.org/core-api/kernel-api.html#resources-management

I think there are a couple kernel-doc includes missing in the `.rst`
for this, so it is not great.

> +/// This is a type alias to `u64` depending on the config option

"to `u32` or `u64`"? (also below)

> + /// The caller must ensure that for the duration of 'a, the pointer will

`'a` (same below).

> + // SAFETY: Safe as per the invariant of `Resource`

"Safe", periods at the end. (few instances)

The last patch on the series has nice examples, thanks! It could be
nice to have some here too (e.g. on how `Flags` and its operators) and
nowadays also KUnit tests, but that can be a good first issue for
later.

Cheers,
Miguel