]> git.ipfire.org Git - thirdparty/linux.git/commit
rust: pci: fix build failure when CONFIG_PCI_MSI is disabled
authorDanilo Krummrich <dakr@kernel.org>
Tue, 2 Dec 2025 21:01:50 +0000 (10:01 +1300)
committerDanilo Krummrich <dakr@kernel.org>
Wed, 3 Dec 2025 11:24:47 +0000 (00:24 +1300)
commit473b9f331718267815649cd93801da832200db71
treed8d8443772f0c7fd5bc4e2adab812d9de768efd5
parentd3666c1f8a31b7ff6805effcfedfac22454c6517
rust: pci: fix build failure when CONFIG_PCI_MSI is disabled

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/
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Reviewed-by: Joel Fernandes <joelagnelf@nvidia.com>
Link: https://patch.msgid.link/20251202210501.40998-1-dakr@kernel.org
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
rust/helpers/pci.c