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: 10558707 X-Patchwork-Delegate: rjw@sisk.pl Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 10B7315E9 for ; Tue, 7 Aug 2018 13:17:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0084628647 for ; Tue, 7 Aug 2018 13:17:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E87A8286AE; Tue, 7 Aug 2018 13:17:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9058C28647 for ; Tue, 7 Aug 2018 13:17:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731399AbeHGPb0 (ORCPT ); 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 X-Virus-Scanned: ClamAV using ClamSMTP 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 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}, {} };