Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1816189rwb; Mon, 7 Nov 2022 06:11:52 -0800 (PST) X-Google-Smtp-Source: AMsMyM6Chu1HJPz9Okw0PGpQJr06PZIJVP8jekYAGq9zmYhS12dL37CtYJZ04+Fcw3vcu9ZQoKvd X-Received: by 2002:a05:6402:5485:b0:459:147a:d902 with SMTP id fg5-20020a056402548500b00459147ad902mr52793077edb.263.1667830312600; Mon, 07 Nov 2022 06:11:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667830312; cv=none; d=google.com; s=arc-20160816; b=yMoEQ4qWq26lnOHgTCvi7I/WTLHdG/0IVlzT9oxsC7PlgPwxrxBSVMOa66B2uYFiln 0+qFjgCvr6wNs4ut75mrMzCXrXiupftqfusjcj1uVi/Y9XUMXitlyQXjgS1ZHu7ygVZL cZI1EWX+z2eoZIjsooIDWc+YVukYHLk0wvdVXn98GBYQofcupVvLWh0XkoOuwZMSUyik ZU28fdP8PG+VISnX1YWOjZ+WBUyVEyUNtGmYOPL0SiJKKRuqBRGDYW+0fAuLVFw+AJpY JvlDBPRPp8xHEBCQIgdxCVVcqfUzB7KmFL3cQvNl9WPuIkz/+GyYKqEbS8niSauvPA0s xkOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=336IY7KpINp383t61ZmzqPDZH18Dlab4FrPD6tRko5Y=; b=oowdrArytTDlem+ONSIH4NXrNrhBlsAiHXHIUyVfBdjYHbBfyZ/5boKQKAPVT6LTF8 2rhMOApHMlw3J1nd15ueglIamPETcYoZSqJjpsn4rLzNBeMjan1D10wiIHzYdQrk3T0K O+9Rok7hQEdNoG2APCCquQqxZAHDgrsLp89zeF09bqT7Y+fAuFn25nbsPFnymhkcCp1H CdN6uG2Yt1L2OUilXCWQivcCKALXQk1iqJEIyCYzebuDgEKvzXcO5kFi1A5frkoogJNK 247ZQLQdQaHgIo8W9xaWnvBO4GncKT1WVrdOt3c848W0KIe344Fq0DPUwwY08da8C9EI 5LoQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dm20-20020a170907949400b00782ff2649a7si10270365ejc.346.2022.11.07.06.11.29; Mon, 07 Nov 2022 06:11:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232047AbiKGNEb (ORCPT + 93 others); Mon, 7 Nov 2022 08:04:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231676AbiKGNEa (ORCPT ); Mon, 7 Nov 2022 08:04:30 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2468ABAA for ; Mon, 7 Nov 2022 05:04:29 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B638060F74 for ; Mon, 7 Nov 2022 13:04:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2BA8EC433D6; Mon, 7 Nov 2022 13:04:25 +0000 (UTC) From: Huacai Chen To: Huacai Chen Cc: loongarch@lists.linux.dev, Xuefeng Li , Guo Ren , Xuerui Wang , Jiaxun Yang , linux-kernel@vger.kernel.org, Huacai Chen Subject: [PATCH] LoongArch: Combine acpi_boot_table_init() and acpi_boot_init() Date: Mon, 7 Nov 2022 21:01:59 +0800 Message-Id: <20221107130159.3698812-1-chenhuacai@loongson.cn> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Combine acpi_boot_table_init() and acpi_boot_init() since they are very simple, and we don't need to check the return value of acpi_boot_init(). Signed-off-by: Huacai Chen --- arch/loongarch/kernel/acpi.c | 31 ++++++++++--------------------- arch/loongarch/kernel/setup.c | 1 - 2 files changed, 10 insertions(+), 22 deletions(-) diff --git a/arch/loongarch/kernel/acpi.c b/arch/loongarch/kernel/acpi.c index 335398482038..8319cc409009 100644 --- a/arch/loongarch/kernel/acpi.c +++ b/arch/loongarch/kernel/acpi.c @@ -56,23 +56,6 @@ void __iomem *acpi_os_ioremap(acpi_physical_address phys, acpi_size size) return ioremap_cache(phys, size); } -void __init acpi_boot_table_init(void) -{ - /* - * If acpi_disabled, bail out - */ - if (acpi_disabled) - return; - - /* - * Initialize the ACPI boot-time table parser. - */ - if (acpi_table_init()) { - disable_acpi(); - return; - } -} - #ifdef CONFIG_SMP static int set_processor_mask(u32 id, u32 flags) { @@ -156,13 +139,21 @@ static void __init acpi_process_madt(void) loongson_sysconf.nr_cpus = num_processors; } -int __init acpi_boot_init(void) +void __init acpi_boot_table_init(void) { /* * If acpi_disabled, bail out */ if (acpi_disabled) - return -1; + return; + + /* + * Initialize the ACPI boot-time table parser. + */ + if (acpi_table_init()) { + disable_acpi(); + return; + } loongson_sysconf.boot_cpu_id = read_csr_cpuid(); @@ -173,8 +164,6 @@ int __init acpi_boot_init(void) /* Do not enable ACPI SPCR console by default */ acpi_parse_spcr(earlycon_acpi_spcr_enable, false); - - return 0; } #ifdef CONFIG_ACPI_NUMA diff --git a/arch/loongarch/kernel/setup.c b/arch/loongarch/kernel/setup.c index 1eb63fa9bc81..ae436def7ee9 100644 --- a/arch/loongarch/kernel/setup.c +++ b/arch/loongarch/kernel/setup.c @@ -257,7 +257,6 @@ void __init platform_init(void) #ifdef CONFIG_ACPI acpi_gbl_use_default_register_widths = false; acpi_boot_table_init(); - acpi_boot_init(); #endif #ifdef CONFIG_NUMA -- 2.31.1