Re: [PATCH] rust: pci: add resource_flags accessor
From: Eliot Courtney
Date: Mon Oct 26 2026 - 00:05:21 EST
On Sat Oct 24, 2026 at 12:40 AM JST, Miguel Ojeda wrote:
> 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
Thanks Miguel! I've sent a fix [1].
[1]: https://lore.kernel.org/all/20261026-pci-fix-v1-1-a6a69ee584d4@xxxxxxxxxx/