rust: io: fix unused Flags::from_raw warning without CONFIG_PCI
Subsystems (3)
PATCH 1/1 rust: io: fix unused Flags::from_raw warning without CONFIG_PCI
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.
--- rust/kernel/io/resource.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
rust/kernel/io/resource.rs +1 -1
@@ -164,7 +164,7 @@ pub fn flags(&self) -> Flags {// SAFETY: Safe as per the invariants of `Resource`. let flags =unsafe { (*inner).flags }; -Flags (flags) +Flags ::from_raw (flags) } }
---
base-commit: 21a7f44fd0765fcc5194130b28767786eba1d1e7
change-id: 20261026-pci-fix-5ac8d9f642c7
Best regards,
Signature · 1 line
Eliot Courtney <[email protected]>
Quoted 11 lines · Eliot Courtney
Currently,
Flags::from_raw()is only used bypci::Device::resource_flags(), so rustc errors (withCONFIG_WERROR) saying that it is never used whenCONFIG_PCIis disabled.error: associated function
from_rawis never used
-->rust/kernel/io/resource.rs:240:25
Resource::flags()also converts the rawflagsfield toFlagsand is built in every config, so the easiest way to get rid of this error is to just use it there too.
Quoted 6 lines
Fixes 3f1e12fce16f ("rust: pci: add resource_flags accessor")Reported-by Miguel Ojeda <[email protected]>Reported-by kernel test robot <[email protected]>Signed-off-by Eliot Courtney <[email protected]>
Quoted 1 line · Eliot Courtney
[PATCH] rust: io: fix unused
Flags::from_rawwarning withoutCONFIG_PCI
Applied, thanks!
Branch: driver-core-linus
Tree: git://git.kernel.org/pub/scm/linux/kernel/git/driver-core/driver-core.git
[1/1] rust: io: fix unused Flags::from_raw warning without CONFIG_PCI
commit: 14098e496671
The patch will appear in the next linux-next integration (typically within 24 hours on weekdays).
The patch is queued up for Linus's tree and should land in the next -rc release.