Re: [PATCH] rust: pci: add resource_flags accessor

From: Miguel Ojeda

Date: Fri Oct 23 2026 - 11:43:25 EST


On Tue, 08 Sep 2026 16:51:48 +0900 Eliot Courtney <ecourtney@xxxxxxxxxx> wrote:
>
> + /// Wrap a raw `c_ulong` value returned by a C API into [`Flags`].
> + pub(crate) const fn from_raw(value: c_ulong) -> Self {
> + Flags(value)
> + }

In linux-next (next-20261022), on UML x86_64, I am seeing:

error: associated function `from_raw` is never used
--> rust/kernel/io/resource.rs:240:25
|
216 | impl Flags {
| ---------- associated function in this implementation
...
240 | pub(crate) const fn from_raw(value: c_ulong) -> Self {
| ^^^^^^^^
|
= note: `-D dead-code` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(dead_code)]`

`kernel::io::resource` is always built, but the only user of `from_raw`
is under `CONFIG_PCI`.

I hope that helps.

Cheers,
Miguel