From 00cdac08b6a4cd81983f60a374be6c32db5577e0 Mon Sep 17 00:00:00 2001 From: Jon Hunter Date: Mon, 29 Apr 2024 09:54:58 +0100 Subject: [PATCH] conftest: Add test for PCI_IRQ_INTX In Linux v6.8, the definition 'PCI_IRQ_LEGACY' was deprecated and renamed as 'PCI_IRQ_INTX'. Add a test for conftest to detect if 'PCI_IRQ_INTX' is defined so that drivers can migrate to the new definition. Bug 4593750 Change-Id: If34c258cfabe407bd15dc7078f2599737368dc58 Signed-off-by: Jon Hunter Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3143016 Reviewed-by: mobile promotions Tested-by: mobile promotions --- scripts/conftest/Makefile | 1 + scripts/conftest/conftest.sh | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/scripts/conftest/Makefile b/scripts/conftest/Makefile index d23b2251..8e80b976 100644 --- a/scripts/conftest/Makefile +++ b/scripts/conftest/Makefile @@ -153,6 +153,7 @@ NV_CONFTEST_FUNCTION_COMPILE_TESTS += pci_enable_pcie_error_reporting NV_CONFTEST_FUNCTION_COMPILE_TESTS += pci_epf_alloc_space_has_epc_features_arg NV_CONFTEST_FUNCTION_COMPILE_TESTS += pci_epf_driver_struct_probe_has_id_arg NV_CONFTEST_FUNCTION_COMPILE_TESTS += pci_epc_irq_type_enum_present +NV_CONFTEST_FUNCTION_COMPILE_TESTS += pci_irq_intx NV_CONFTEST_FUNCTION_COMPILE_TESTS += register_shrinker_has_fmt_arg NV_CONFTEST_FUNCTION_COMPILE_TESTS += shrinker_alloc NV_CONFTEST_FUNCTION_COMPILE_TESTS += slab_mem_spread diff --git a/scripts/conftest/conftest.sh b/scripts/conftest/conftest.sh index e2107072..89843940 100755 --- a/scripts/conftest/conftest.sh +++ b/scripts/conftest/conftest.sh @@ -7504,6 +7504,25 @@ compile_test() { compile_check_conftest "$CODE" "PCI_EPC_IRQ_TYPE_ENUM_PRESENT" "" "types" ;; + + pci_irq_intx) + # + # Determine if PCI_IRQ_INTX is defined. + # + # Commit 58ff9c5acb4a ("PCI: Rename PCI_IRQ_LEGACY to PCI_IRQ_INTX") + # added the definition 'PCI_IRQ_INTX' in Linux v6.8 and commit + # 0e1fdd222f0a ("PCI: Remove PCI_IRQ_LEGACY") removed the definition + # 'PCI_IRQ_LEGACY' completely in Linux v6.10. + # + CODE=" + #include + int conftest_pci_irq_intx(void) { + return PCI_IRQ_INTX; + }" + + compile_check_conftest "$CODE" "NV_PCI_IRQ_INTX" "" "types" + ;; + register_shrinker_has_fmt_arg) # # Determine if the 'register_shrinker' function