rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alice Ryhl <aliceryhl@google.com>
To: Danilo Krummrich <dakr@kernel.org>
Cc: bhelgaas@google.com, kwilczynski@kernel.org, ojeda@kernel.org,
	 alex.gaynor@gmail.com, boqun.feng@gmail.com, gary@garyguo.net,
	 bjorn3_gh@protonmail.com, lossin@kernel.org,
	a.hindborg@kernel.org,  tmgross@umich.edu, joelagnelf@nvidia.com,
	linux-pci@vger.kernel.org,  rust-for-linux@vger.kernel.org,
	linux-kernel@vger.kernel.org,  kernel test robot <lkp@intel.com>
Subject: Re: [PATCH] rust: pci: fix build failure when CONFIG_PCI_MSI is disabled
Date: Wed, 3 Dec 2025 08:59:51 +0000	[thread overview]
Message-ID: <aS_8ByHdEDZHj1F-@google.com> (raw)
In-Reply-To: <20251202210501.40998-1-dakr@kernel.org>

On Wed, Dec 03, 2025 at 10:01:50AM +1300, Danilo Krummrich wrote:
> When CONFIG_PCI_MSI is disabled pci_alloc_irq_vectors() and
> pci_free_irq_vectors() are defined as inline functions and hence require
> a Rust helper.
> 
> 	error[E0425]: cannot find function `pci_alloc_irq_vectors` in crate `bindings`
> 	    --> rust/kernel/pci/irq.rs:144:23
> 	     |
> 	 144 | ...s::pci_alloc_irq_vectors(dev.as_raw(), min_vecs, max_vecs, irq_types.as_raw())
> 	     |       ^^^^^^^^^^^^^^^^^^^^^ help: a function with a similar name exists: `pci_irq_vector`
> 	     |
> 	    ::: .../rust/bindings/bindings_helpers_generated.rs:1197:5
> 	     |
> 	1197 |     pub fn pci_irq_vector(pdev: *mut pci_dev, nvec: ffi::c_uint) -> ffi::c_int;
> 	     |     --------------------------------------------------------------------------- similarly named function `pci_irq_vector` defined here
> 
> 	error[E0425]: cannot find function `pci_free_irq_vectors` in crate `bindings`
> 	    --> rust/kernel/pci/irq.rs:170:28
> 	     |
> 	 170 |         unsafe { bindings::pci_free_irq_vectors(self.dev.as_raw()) };
> 	     |                            ^^^^^^^^^^^^^^^^^^^^ help: a function with a similar name exists: `pci_irq_vector`
> 	     |
> 	    ::: .../rust/bindings/bindings_helpers_generated.rs:1197:5
> 	     |
> 	1197 |     pub fn pci_irq_vector(pdev: *mut pci_dev, nvec: ffi::c_uint) -> ffi::c_int;
> 	     |     --------------------------------------------------------------------------- similarly named function `pci_irq_vector` defined here
> 
> 	error: aborting due to 2 previous errors
> 
> Fix this by adding the corresponding helpers.
> 
> Fixes: 340ccc973544 ("rust: pci: Allocate and manage PCI interrupt vectors")
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202512012238.YgVvRRUx-lkp@intel.com/
> Signed-off-by: Danilo Krummrich <dakr@kernel.org>

It may make sense to add __rust_helper to these helpers right away.

otherwise:
Reviewed-by: Alice Ryhl <aliceryhl@google.com>

Alice

For context:
https://lore.kernel.org/all/20251202-define-rust-helper-v1-0-a2e13cbc17a6@google.com/


      parent reply	other threads:[~2025-12-03  8:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-02 21:01 [PATCH] rust: pci: fix build failure when CONFIG_PCI_MSI is disabled Danilo Krummrich
2025-12-02 21:08 ` Joel Fernandes
2025-12-03  8:59 ` Alice Ryhl [this message]

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=aS_8ByHdEDZHj1F-@google.com \
    --to=aliceryhl@google.com \
    --cc=a.hindborg@kernel.org \
    --cc=alex.gaynor@gmail.com \
    --cc=bhelgaas@google.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=dakr@kernel.org \
    --cc=gary@garyguo.net \
    --cc=joelagnelf@nvidia.com \
    --cc=kwilczynski@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=lossin@kernel.org \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=tmgross@umich.edu \
    /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;
as well as URLs for NNTP newsgroup(s).