[PATCH] ACPICA: scope PCI region setup helpers to ACPI_PCI_CONFIGURED

Pengpeng Hou posted 1 patch 1 month ago
[PATCH] ACPICA: scope PCI region setup helpers to ACPI_PCI_CONFIGURED
Posted by Pengpeng Hou 1 month ago
In current linux.git (1954c4f01220), acpi_ev_pci_config_region_setup()
and acpi_ev_pci_bar_region_setup() are defined and declared 
unconditionally. However, their only in-tree references are within 
evhandler.c, which are already guarded by #ifdef ACPI_PCI_CONFIGURED.

Match the internal declarations and definitions to that scope by wrapping
them in #ifdef ACPI_PCI_CONFIGURED. This fixes the config-scope mismatch
and avoids including PCI-specific setup logic when PCI support is not
configured in the ACPI subsystem.

Signed-off-by: Pengpeng Hou <pengpeng.hou@isrc.iscas.ac.cn>
---
diff --git a/drivers/acpi/acpica/acevents.h b/drivers/acpi/acpica/acevents.h
--- a/drivers/acpi/acpica/acevents.h
+++ b/drivers/acpi/acpica/acevents.h
@@
 acpi_status
 acpi_ev_io_space_region_setup(acpi_handle handle,
 			      u32 function,
 			      void *handler_context, void **region_context);
 
+#ifdef ACPI_PCI_CONFIGURED
 acpi_status
 acpi_ev_pci_config_region_setup(acpi_handle handle,
 				u32 function,
 				void *handler_context, void **region_context);
@@
 acpi_status
 acpi_ev_pci_bar_region_setup(acpi_handle handle,
 			     u32 function,
 			     void *handler_context, void **region_context);
+#endif
 
 acpi_status
 acpi_ev_data_table_region_setup(acpi_handle handle,
 				u32 function,
diff --git a/drivers/acpi/acpica/evrgnini.c b/drivers/acpi/acpica/evrgnini.c
--- a/drivers/acpi/acpica/evrgnini.c
+++ b/drivers/acpi/acpica/evrgnini.c
@@
  *
  ******************************************************************************/
 
+#ifdef ACPI_PCI_CONFIGURED
 acpi_status
 acpi_ev_pci_config_region_setup(acpi_handle handle,
 				u32 function,
 				void *handler_context, void **region_context)
@@
 	*region_context = pci_id;
 	return_ACPI_STATUS(AE_OK);
 }
+#endif
 
 /*******************************************************************************
  *
  * FUNCTION:    acpi_ev_is_pci_root_bridge
@@
  *
  ******************************************************************************/
 
+#ifdef ACPI_PCI_CONFIGURED
 acpi_status
 acpi_ev_pci_bar_region_setup(acpi_handle handle,
 			     u32 function,
 			     void *handler_context, void **region_context)
@@
 
 	return_ACPI_STATUS(AE_OK);
 }
+#endif
 
 /*******************************************************************************
  *
  * FUNCTION:    acpi_ev_cmos_region_setup