PCI/MSI: Provide missing stubs for CONFIG_PCI_MSI=n
authorReinette Chatre <reinette.chatre@intel.com>
Thu, 9 Feb 2023 21:49:00 +0000 (13:49 -0800)
committerThomas Gleixner <tglx@linutronix.de>
Mon, 13 Feb 2023 11:17:20 +0000 (12:17 +0100)
commit2b129f0b24ab578b02901b4a1744b7f97399faa0
treed0f7e7c2f73e45ee313cd29fd142e052a76e5533
parentceaa837f96adb69c0df0397937cd74991d5d821a
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 <lkp@intel.com>
Fixes: 34026364df8e ("PCI/MSI: Provide post-enable dynamic allocation interfaces for MSI-X")
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/158e40e1cfcfc58ae30ecb2bbfaf86e5bba7a1ef.1675978686.git.reinette.chatre@intel.com
include/linux/pci.h