Skip to content

Commit 2b129f0

Browse files
rchatreKAGA-KOKO
authored andcommitted
PCI/MSI: Provide missing stubs for CONFIG_PCI_MSI=n
pci_msix_alloc_irq_at() and pci_msix_free_irq() are not declared when CONFIG_PCI_MSI is disabled. Users of these two calls do not yet exist but when users do appear (shown below is an attempt to use the new API in vfio-pci) the following errors will be encountered when compiling with CONFIG_PCI_MSI disabled: drivers/vfio/pci/vfio_pci_intrs.c:461:4: error: implicit declaration of\ function 'pci_msix_free_irq' is invalid in C99\ [-Werror,-Wimplicit-function-declaration] pci_msix_free_irq(pdev, msix_map); ^ drivers/vfio/pci/vfio_pci_intrs.c:511:15: error: implicit declaration of\ function 'pci_msix_alloc_irq_at' is invalid in C99\ [-Werror,-Wimplicit-function-declaration] msix_map = pci_msix_alloc_irq_at(pdev, vector, NULL); Provide definitions for pci_msix_alloc_irq_at() and pci_msix_free_irq() in preparation for users that need to compile when CONFIG_PCI_MSI is disabled. Reported-by: kernel test robot <[email protected]> Fixes: 3402636 ("PCI/MSI: Provide post-enable dynamic allocation interfaces for MSI-X") Signed-off-by: Reinette Chatre <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Link: https://lore.kernel.org/r/158e40e1cfcfc58ae30ecb2bbfaf86e5bba7a1ef.1675978686.git.reinette.chatre@intel.com
1 parent ceaa837 commit 2b129f0

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

include/linux/pci.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1621,6 +1621,18 @@ pci_alloc_irq_vectors(struct pci_dev *dev, unsigned int min_vecs,
16211621
flags, NULL);
16221622
}
16231623

1624+
static inline struct msi_map pci_msix_alloc_irq_at(struct pci_dev *dev, unsigned int index,
1625+
const struct irq_affinity_desc *affdesc)
1626+
{
1627+
struct msi_map map = { .index = -ENOSYS, };
1628+
1629+
return map;
1630+
}
1631+
1632+
static inline void pci_msix_free_irq(struct pci_dev *pdev, struct msi_map map)
1633+
{
1634+
}
1635+
16241636
static inline void pci_free_irq_vectors(struct pci_dev *dev)
16251637
{
16261638
}

0 commit comments

Comments
 (0)