ACPI / scan: Add static attribute to indirect_io_hosts[]
authorJohn Garry <john.garry@huawei.com>
Tue, 7 Aug 2018 13:15:05 +0000 (21:15 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 9 Aug 2018 08:51:49 +0000 (10:51 +0200)
Array indirect_io_hosts[] is declared in acpi_is_indirect_io_slave() as a
const array, which means that the array will be re-built for each call.

Optimise by adding the static attribute, which means that the array is
added to const-data pool and not re-built per function call.

Reported-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: John Garry <john.garry@huawei.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/scan.c

index 970dd87d347c786fbc25922464e6bc20c1dbb4ee..199c8ea6896c1dd98b9df3dde0410e4e74d15b4c 100644 (file)
@@ -1528,7 +1528,7 @@ static int acpi_check_serial_bus_slave(struct acpi_resource *ares, void *data)
 static bool acpi_is_indirect_io_slave(struct acpi_device *device)
 {
        struct acpi_device *parent = device->parent;
-       const struct acpi_device_id indirect_io_hosts[] = {
+       static const struct acpi_device_id indirect_io_hosts[] = {
                {"HISI0191", 0},
                {}
        };