Skip to content

Commit

Permalink
ACPI / scan: Add static attribute to indirect_io_hosts[]
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
John Garry authored and Rafael J. Wysocki committed Aug 9, 2018
1 parent 1ffaddd commit a6f0729
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/acpi/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -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},
{}
};
Expand Down

0 comments on commit a6f0729

Please sign in to comment.