Skip to contentSkip to conversation

ACPI: PCI: Switch to use acpi_evaluate_dsm_typed()

PATCH Applied Andy Shevchenko 2 participants 2 messages Oct 2, 2023 – Oct 3, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ACPI: PCI: Switch to use acpi_evaluate_dsm_typed()

The acpi_evaluate_dsm_typed() provides a way to check the type of the object evaluated by _DSM call. Use it instead of open coded variant.

---
 drivers/acpi/pci_root.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/acpi/pci_root.c +3 -3
index 84030804a763..58b89b8d950e 100644
@@ -1055,9 +1055,9 @@ struct pci_bus *acpi_pci_root_create(struct acpi_pci_root *root,
 	 * exists and returns 0, we must preserve any PCI resource
 	 * assignments made by firmware for this host bridge.
 	 */
-	obj = acpi_evaluate_dsm(ACPI_HANDLE(bus->bridge), &pci_acpi_dsm_guid, 1,
-				DSM_PCI_PRESERVE_BOOT_CONFIG, NULL);
-	if (obj && obj->type == ACPI_TYPE_INTEGER && obj->integer.value == 0)
+	obj = acpi_evaluate_dsm_typed(ACPI_HANDLE(bus->bridge), &pci_acpi_dsm_guid, 1,
+				      DSM_PCI_PRESERVE_BOOT_CONFIG, NULL, ACPI_TYPE_INTEGER);
+	if (obj && obj->integer.value == 0)
 		host_bridge->preserve_config = 1;
 	ACPI_FREE(obj);
 
Signature · 1 line
2.40.0.1.gaa8946217a0b
maintainer Applied
#1 lore raw
Quoted 17 lines · Andy Shevchenko

The acpi_evaluate_dsm_typed() provides a way to check the type of the object evaluated by _DSM call. Use it instead of open coded variant.

---
 drivers/acpi/pci_root.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/acpi/pci_root.c +0 -0
index 84030804a763..58b89b8d950e 100644
@@ -1055,9 +1055,9 @@ struct pci_bus *acpi_pci_root_create(struct acpi_pci_root *root,
         * exists and returns 0, we must preserve any PCI resource
         * assignments made by firmware for this host bridge.
         */

drivers/acpi/pci_root.c struct pci_bus *acpi_pci_root_create(struct acpi_pci_root *root,

Quoted 10 lines
drivers/acpi/pci_root.c +3 -4
-       obj = acpi_evaluate_dsm(ACPI_HANDLE(bus->bridge), &pci_acpi_dsm_guid, 1,
-                               DSM_PCI_PRESERVE_BOOT_CONFIG, NULL);
-       if (obj && obj->type == ACPI_TYPE_INTEGER && obj->integer.value == 0)
+       obj = acpi_evaluate_dsm_typed(ACPI_HANDLE(bus->bridge), &pci_acpi_dsm_guid, 1,
+                                     DSM_PCI_PRESERVE_BOOT_CONFIG, NULL, ACPI_TYPE_INTEGER);
+       if (obj && obj->integer.value == 0)
                host_bridge->preserve_config = 1;
        ACPI_FREE(obj);
 
--

Applied as 6.7 material, thanks!