From patchwork Tue Oct 25 05:21:36 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lv Zheng X-Patchwork-Id: 9393995 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7FBAB60231 for ; Tue, 25 Oct 2016 05:22:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7524428D94 for ; Tue, 25 Oct 2016 05:22:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 69B9528EB0; Tue, 25 Oct 2016 05:22:43 +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=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID 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 CF01428D94 for ; Tue, 25 Oct 2016 05:22:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S941457AbcJYFWk (ORCPT ); Tue, 25 Oct 2016 01:22:40 -0400 Received: from mail-oi0-f65.google.com ([209.85.218.65]:36145 "EHLO mail-oi0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755257AbcJYFWA (ORCPT ); Tue, 25 Oct 2016 01:22:00 -0400 Received: by mail-oi0-f65.google.com with SMTP id e12so5267087oib.3; Mon, 24 Oct 2016 22:21:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=DnD1HDc347wihfDvvKLwDRpuavANSeKmReLe8MNmqrU=; b=hZRXQ/PBZJZIKw1XLgzkeZhY2Gvoa1jwWNqvJGQyhCSQPJsePQGX/g/WrN/Ai8gT4E 0XXJJt6dX7ypx/BeHy/mpm1Kc72LFOLGrncSTlycQfV0XJVFfOBrsd3BjORoIA5x9TJW jT7+MlvO3YfOeQUHFsPbYb6XmrIWKDSYB6WlJqcN7lbw64eI47NF099sRBr5RNFWG1mH SGr01UpBkLRNSgeR/zz7sWD4rO+qNa8StK7lf6JXkU+zpRTProRLkVaEwJ8cURCewLi9 A/GGjtvKgCv8Jlg9AP69+0KPIUZgzNMA63lowu67W1Vz7fRvqG+Qy65UZIQOHAB3Dvk2 nHlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=DnD1HDc347wihfDvvKLwDRpuavANSeKmReLe8MNmqrU=; b=P7HOR7fBdZjj0O9UP17iOvev/xmTnkbHSN5gnoTq6w2Qs21AcVnAOaiTxRv/t0ckOG T0/8Rr40KtFO+2Ug6+btKV2Rhf1/giUCGon0Pfs539ji+WXJn4IjMD/ZMI2LEVVaOhni n8ftnYjxFwAALS85rus2m8wU7i4Gqx88876WTvacbefkqNeiMUJIY7ZNQ6fkRC9xnD8n tKib4i1vBCaob8WXloVk/ZeDXizp12QLwL33PLlYPVgJWff0qCjdotBXAy1yrf5BkX14 EkBb8ruP/VRxybqcS0yzlhTWk0NfTLTWqJ7QhWjbwWJaA1EgtJ0vCjyYaBINPkFkD3JT Fn8A== X-Gm-Message-State: ABUngve7OivUknxlQcg6cvIUhhW+RX3spaGdGEquk3+Il770UkDkP+xgS0fdeftL3sUTcQ== X-Received: by 10.157.39.2 with SMTP id r2mr3734590ota.103.1477372900013; Mon, 24 Oct 2016 22:21:40 -0700 (PDT) Received: from localhost.localdomain (h3.246.129.40.static.ip.windstream.net. [40.129.246.3]) by smtp.gmail.com with ESMTPSA id 31sm5103196oth.13.2016.10.24.22.21.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 24 Oct 2016 22:21:39 -0700 (PDT) From: Lv Zheng X-Google-Original-From: Lv Zheng To: "Rafael J . Wysocki" , "Rafael J . Wysocki" , Len Brown Cc: linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, Lv Zheng Subject: [PATCH 5/6] ACPICA: Tables: Cleanup acpi_tb_install_and_load_table() Date: Tue, 25 Oct 2016 13:21:36 +0800 Message-Id: X-Mailer: git-send-email 2.7.4 In-Reply-To: References: 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 acpi_tb_install_and_load_table() can invoke acpi_tb_load_table() to eliminate redundant code. No functional change. Lv Zheng. Signed-off-by: Lv Zheng --- drivers/acpi/acpica/actables.h | 3 +-- drivers/acpi/acpica/exconfig.c | 7 +++---- drivers/acpi/acpica/tbdata.c | 45 +++++------------------------------------- drivers/acpi/acpica/tbxfload.c | 7 +++---- 4 files changed, 12 insertions(+), 50 deletions(-) diff --git a/drivers/acpi/acpica/actables.h b/drivers/acpi/acpica/actables.h index e85953b..1850005 100644 --- a/drivers/acpi/acpica/actables.h +++ b/drivers/acpi/acpica/actables.h @@ -127,8 +127,7 @@ acpi_status acpi_tb_load_table(u32 table_index, struct acpi_namespace_node *parent_node); acpi_status -acpi_tb_install_and_load_table(struct acpi_table_header *table, - acpi_physical_address address, +acpi_tb_install_and_load_table(acpi_physical_address address, u8 flags, u8 override, u32 *table_index); void acpi_tb_terminate(void); diff --git a/drivers/acpi/acpica/exconfig.c b/drivers/acpi/acpica/exconfig.c index 718428b..8b8d620 100644 --- a/drivers/acpi/acpica/exconfig.c +++ b/drivers/acpi/acpica/exconfig.c @@ -437,10 +437,9 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc, ACPI_INFO(("Dynamic OEM Table Load:")); acpi_ex_exit_interpreter(); - status = - acpi_tb_install_and_load_table(table, ACPI_PTR_TO_PHYSADDR(table), - ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL, - TRUE, &table_index); + status = acpi_tb_install_and_load_table(ACPI_PTR_TO_PHYSADDR(table), + ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL, + TRUE, &table_index); acpi_ex_enter_interpreter(); if (ACPI_FAILURE(status)) { diff --git a/drivers/acpi/acpica/tbdata.c b/drivers/acpi/acpica/tbdata.c index d9ca8c2..4cbfa30 100644 --- a/drivers/acpi/acpica/tbdata.c +++ b/drivers/acpi/acpica/tbdata.c @@ -832,9 +832,9 @@ acpi_tb_load_table(u32 table_index, struct acpi_namespace_node *parent_node) * * FUNCTION: acpi_tb_install_and_load_table * - * PARAMETERS: table - Pointer to the table - * address - Physical address of the table + * PARAMETERS: address - Physical address of the table * flags - Allocation flags of the table + * override - Whether override should be performed * table_index - Where table index is returned * * RETURN: Status @@ -844,15 +844,13 @@ acpi_tb_load_table(u32 table_index, struct acpi_namespace_node *parent_node) ******************************************************************************/ acpi_status -acpi_tb_install_and_load_table(struct acpi_table_header *table, - acpi_physical_address address, +acpi_tb_install_and_load_table(acpi_physical_address address, u8 flags, u8 override, u32 *table_index) { acpi_status status; u32 i; - acpi_owner_id owner_id; - ACPI_FUNCTION_TRACE(acpi_load_table); + ACPI_FUNCTION_TRACE(tb_install_and_load_table); (void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES); @@ -864,41 +862,8 @@ acpi_tb_install_and_load_table(struct acpi_table_header *table, goto unlock_and_exit; } - /* - * Note: Now table is "INSTALLED", it must be validated before - * using. - */ - status = acpi_tb_validate_table(&acpi_gbl_root_table_list.tables[i]); - if (ACPI_FAILURE(status)) { - goto unlock_and_exit; - } - (void)acpi_ut_release_mutex(ACPI_MTX_TABLES); - status = acpi_ns_load_table(i, acpi_gbl_root_node); - - /* Execute any module-level code that was found in the table */ - - if (!acpi_gbl_parse_table_as_term_list - && acpi_gbl_group_module_level_code) { - acpi_ns_exec_module_code_list(); - } - - /* - * Update GPEs for any new _Lxx/_Exx methods. Ignore errors. The host is - * responsible for discovering any new wake GPEs by running _PRW methods - * that may have been loaded by this table. - */ - status = acpi_tb_get_owner_id(i, &owner_id); - if (ACPI_SUCCESS(status)) { - acpi_ev_update_gpes(owner_id); - } - - /* Invoke table handler if present */ - - if (acpi_gbl_table_handler) { - (void)acpi_gbl_table_handler(ACPI_TABLE_EVENT_LOAD, table, - acpi_gbl_table_handler_context); - } + status = acpi_tb_load_table(i, acpi_gbl_root_node); (void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES); unlock_and_exit: diff --git a/drivers/acpi/acpica/tbxfload.c b/drivers/acpi/acpica/tbxfload.c index 5569f63..35d3f9b 100644 --- a/drivers/acpi/acpica/tbxfload.c +++ b/drivers/acpi/acpica/tbxfload.c @@ -326,10 +326,9 @@ acpi_status acpi_load_table(struct acpi_table_header *table) /* Install the table and load it into the namespace */ ACPI_INFO(("Host-directed Dynamic ACPI Table Load:")); - status = - acpi_tb_install_and_load_table(table, ACPI_PTR_TO_PHYSADDR(table), - ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL, - FALSE, &table_index); + status = acpi_tb_install_and_load_table(ACPI_PTR_TO_PHYSADDR(table), + ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL, + FALSE, &table_index); return_ACPI_STATUS(status); }