From patchwork Tue Aug 7 13:15:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 143581 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp4499224ljj; Tue, 7 Aug 2018 06:17:09 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeVdbGHQNVmNVObW7n/VPSiDM0bs8grjmSBmY4neRRkDZ44JfOS9chwjVNpmA74TYPQNOI6 X-Received: by 2002:a63:c20:: with SMTP id b32-v6mr18222659pgl.400.1533647829581; Tue, 07 Aug 2018 06:17:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533647829; cv=none; d=google.com; s=arc-20160816; b=pHyC26NjKskiQG1idJFevwYNLfzjS9dBqYWTCkt2FllD6rggnVWQ05dZ/qCEdLgJYU Okm6wsjtklMT1g01j6MY6xYBvEoVGuZBAeCUj1D/Pn1xt5DTFqHwgHriG7OHY4iXbJSu 5n4WRNzeEgEKiRO4hNCup9z9JX3kMWRl6pqdm5E6XMyasU7G01IO2qSGYWxAxi+N9LaE FVxySh6svptpk5jp+Vvh8NO70JQ5oPnWRS/cXV/Vx24w5s6ymvoYXSUZV8RQSKiwUH+N gQGuJeon/N3QOAhV+3Ik/bbUgOH6KM8A9yxsbFkpHp0ivqAs0qtJd2TJKoQi9TJ9ni+0 HUDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:arc-authentication-results; bh=vanMojj5EmDPwBqc9duljm3LfSxf9a3LeNIeqr+A7zo=; b=xbWxSk9EhxAFhe8FLU8Gee11EM8MeR5Vtx2kWNV0w6CjyfMZINxvZcztNl1NGeipiV atxf6GUrqqfK/Ilfvj4Nc502lqKjPd+8T4AqSBaWdGukyVlzH7Hz297GBHSN/jWwT3XJ sZ0gR3DveyXQIhU0Ino1egu81NTY6IH5nuq5ceHiH9CndC806gXIAUypgezBKAKkaeK7 YyLs9Py3LyVqr+gg4Rmn6XZ9qVoZ78TY/LDMz58iMOPa48M4JDwe4lWQvF+jMua+H1wy iq+Wp4XiNXvTCUOeHUzJk5byxKmtZISBXzL2TN3JTmE+D/MUvZKVuvPgohEeQJlxefxE zvfA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-acpi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-acpi-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1-v6si1047897pls.385.2018.08.07.06.17.09; Tue, 07 Aug 2018 06:17:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-acpi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-acpi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-acpi-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731399AbeHGPb0 (ORCPT + 9 others); Tue, 7 Aug 2018 11:31:26 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:10676 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728258AbeHGPb0 (ORCPT ); Tue, 7 Aug 2018 11:31:26 -0400 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id DE61D33560FA4; Tue, 7 Aug 2018 21:17:04 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.399.0; Tue, 7 Aug 2018 21:16:59 +0800 From: John Garry To: , , CC: , , , John Garry Subject: [PATCH] ACPI / scan: Add static attribute to indirect_io_hosts[] Date: Tue, 7 Aug 2018 21:15:05 +0800 Message-ID: <1533647705-34313-1-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Originating-IP: [10.67.212.75] X-CFilter-Loop: Reflected Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org 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 Signed-off-by: John Garry -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index 970dd87..199c8ea6 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c @@ -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}, {} };