Skip to content

Commit 877fee2

Browse files
jwrdegoedebjorn-helgaas
authored andcommitted
PCI: Convert pci_dev_present() stub to static inline
Change the pci_dev_present() stub which is used when CONFIG_PCI is not set from a #define to a static inline stub. Thix should fix clang -Werror builds failing due to errors like this: drivers/platform/x86/thinkpad_acpi.c:4475:35: error: unused variable 'fwbug_cards_ids' [-Werror,-Wunused-const-variable] Where fwbug_cards_ids is an array of pci_device_id passed to pci_dev_present() during a quirk check. Link: https://lore.kernel.org/r/20211217141515.379586-1-hdegoede@redhat.com Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Cc: platform-driver-x86@vger.kernel.org
1 parent d2c64f9 commit 877fee2

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

include/linux/pci.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1775,7 +1775,10 @@ static inline struct pci_dev *pci_get_class(unsigned int class,
17751775
struct pci_dev *from)
17761776
{ return NULL; }
17771777

1778-
#define pci_dev_present(ids) (0)
1778+
1779+
static inline int pci_dev_present(const struct pci_device_id *ids)
1780+
{ return 0; }
1781+
17791782
#define no_pci_devices() (1)
17801783
#define pci_dev_put(dev) do { } while (0)
17811784

0 commit comments

Comments
 (0)