mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Eliot Courtney <ecourtney@nvidia.com>
To: "Danilo Krummrich" <dakr@kernel.org>,
	"Alice Ryhl" <aliceryhl@google.com>,
	"Daniel Almeida" <daniel.almeida@collabora.com>,
	"Miguel Ojeda" <ojeda@kernel.org>,
	"Boqun Feng" <boqun@kernel.org>, "Gary Guo" <gary@garyguo.net>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Benno Lossin" <lossin@kernel.org>,
	"Andreas Hindborg" <a.hindborg@kernel.org>,
	"Trevor Gross" <tmgross@umich.edu>,
	"Tamir Duberstein" <tamird@kernel.org>,
	"Onur Özkan" <work@onurozkan.dev>
Cc: John Hubbard <jhubbard@nvidia.com>,
	 Alistair Popple <apopple@nvidia.com>,
	Timur Tabi <ttabi@nvidia.com>,
	 Alexandre Courbot <acourbot@nvidia.com>,
	driver-core@lists.linux.dev,  rust-for-linux@vger.kernel.org,
	linux-kernel@vger.kernel.org,  kernel test robot <lkp@intel.com>,
	Eliot Courtney <ecourtney@nvidia.com>
Subject: [PATCH] rust: io: fix unused Flags::from_raw warning without CONFIG_PCI
Date: Mon, 26 Oct 2026 12:53:20 +0900	[thread overview]
Message-ID: <20261026-pci-fix-v1-1-a6a69ee584d4@nvidia.com> (raw)

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@kernel.org>
Closes: https://lore.kernel.org/all/20261023154005.95904-1-ojeda@kernel.org/
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202610241133.L9VWoFcD-lkp@intel.com/
Signed-off-by: Eliot Courtney <ecourtney@nvidia.com>
---
 rust/kernel/io/resource.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/rust/kernel/io/resource.rs b/rust/kernel/io/resource.rs
index 758ce62b3cce..29771355cfce 100644
--- a/rust/kernel/io/resource.rs
+++ b/rust/kernel/io/resource.rs
@@ -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,
--  
Eliot Courtney <ecourtney@nvidia.com>


             reply	other threads:[~2026-10-26  3:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-26  3:53 Eliot Courtney [this message]
2026-10-26  4:55 ` Alexandre Courbot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261026-pci-fix-v1-1-a6a69ee584d4@nvidia.com \
    --to=ecourtney@nvidia.com \
    --cc=a.hindborg@kernel.org \
    --cc=acourbot@nvidia.com \
    --cc=aliceryhl@google.com \
    --cc=apopple@nvidia.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun@kernel.org \
    --cc=dakr@kernel.org \
    --cc=daniel.almeida@collabora.com \
    --cc=driver-core@lists.linux.dev \
    --cc=gary@garyguo.net \
    --cc=jhubbard@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=lossin@kernel.org \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=tamird@kernel.org \
    --cc=tmgross@umich.edu \
    --cc=ttabi@nvidia.com \
    --cc=work@onurozkan.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®