Re: [PATCH] rust: io: fix unused Flags::from_raw warning without CONFIG_PCI

From: Alexandre Courbot

Date: Mon Oct 26 2026 - 00:56:23 EST


On Mon Oct 26, 2026 at 12:53 PM JST, Eliot Courtney wrote:
> Currently, `Flags::from_raw()` is only used by
> `pci::Device::resource_flags()`, so rustc errors (with CONFIG_WERROR)
> saying that it is never used when `CONFIG_PCI` is disabled.
>
> error: associated function `from_raw` is never used
> --> rust/kernel/io/resource.rs:240:25
>
> `Resource::flags()` also converts the raw `flags` field to `Flags` and is
> built in every config, so the easiest way to get rid of this error is
> to just use it there too.
>
> Fixes: 3f1e12fce16f ("rust: pci: add resource_flags accessor")
> Reported-by: Miguel Ojeda <ojeda@xxxxxxxxxx>
> Closes: https://lore.kernel.org/all/20261023154005.95904-1-ojeda@xxxxxxxxxx/
> Reported-by: kernel test robot <lkp@xxxxxxxxx>
> Closes: https://lore.kernel.org/oe-kbuild-all/202610241133.L9VWoFcD-lkp@xxxxxxxxx/
> Signed-off-by: Eliot Courtney <ecourtney@xxxxxxxxxx>

Reviewed-by: Alexandre Courbot <acourbot@xxxxxxxxxx>