From: Heikki Krogerus Date: Tue, 16 Aug 2022 10:16:25 +0000 (+0300) Subject: ACPI: resource: Filter out the non memory resources in is_memory() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=6d2b5a1cf4dd943909a927133664ad1627783d95;p=linux.git ACPI: resource: Filter out the non memory resources in is_memory() This will generalise the function so it should become useful in more places. Signed-off-by: Heikki Krogerus Signed-off-by: Rafael J. Wysocki --- diff --git a/drivers/acpi/resource.c b/drivers/acpi/resource.c index 510cdec375c4d..e644e90d18847 100644 --- a/drivers/acpi/resource.c +++ b/drivers/acpi/resource.c @@ -690,6 +690,9 @@ static int is_memory(struct acpi_resource *ares, void *not_used) memset(&win, 0, sizeof(win)); + if (acpi_dev_filter_resource_type(ares, IORESOURCE_MEM)) + return 1; + return !(acpi_dev_resource_memory(ares, res) || acpi_dev_resource_address_space(ares, &win) || acpi_dev_resource_ext_address_space(ares, &win));