Received: by 10.213.65.68 with SMTP id h4csp305181imn; Tue, 20 Mar 2018 04:08:38 -0700 (PDT) X-Google-Smtp-Source: AG47ELsPlpplaobCVxvAkomlpB9rVoJRkr2Umq98mD87bcRYGoeAtdCWgXfB1nppmx71ZHZvRVgd X-Received: by 10.98.156.16 with SMTP id f16mr13344985pfe.180.1521544118530; Tue, 20 Mar 2018 04:08:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521544118; cv=none; d=google.com; s=arc-20160816; b=zi9o5cSJjGm7u+VyiYanpAwgmGkhxPHzRQPee0QVxPZCtsOv+Jf0+iq7ct8fOLeoZ2 1wSwBVfrsIP+2q9PskL0pF5LLtd80PMf65rnLQtmnuZLdQ1VRBxnL7GzDiI0gVN9EvuC /zBtaHa7JRIamH4BBg/0JiD7a5Eh6nIhyWmJbFhzF0PWe0p0EQAKpMdoA6JHE2czwtLs rO4wLGgVi13FVcBTfGXwRTvZaiJNxxeIYnxhC6Od6WVuMX9raMIL3MbBHNExW6aC0VKp 4084xzh2hfTNoymVJi5xO+RHfiNj7vzMPc/18TA+S0P5ltYHrFYi+x4UD7ldWAKwPVyA bfPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=J+IE7U5DxYiZW1zxpr40ChCMJyNtYpV9huCFC3+3lgA=; b=nSN/QuVvbx2tw/CE4Xp0RnTUMmippR7V8cTt7yuEGswBPuiW3Pa6Vg8/QQGRXTiQfE j/wi+FlAZXa8EODKeakaQy3Gh69hE++fxm7eh5YtrGpfcyHR3PhkV0sUXFCVYsbol+9z lIIxWYdNsNMFVDHF7eWP7e93SRqRzwD4g5lgh700OHAtMiN9JVrDoZaD7rFIQYwidwwm 9KJaZceXN0I/6Eu18GozKRFqdqhE9rI7pVTsaiiQtPiKPadFBaf6BN+C5VPvsvzj5+pi L7439GdW/M4TZOKivfKS3lPo1bqum7AZrjHJtnjG3lM2Fh1xkVBRMYqkRPyRky1d2lVk XXyQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 u188si1110744pfb.220.2018.03.20.04.08.24; Tue, 20 Mar 2018 04:08:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753063AbeCTLG6 (ORCPT + 99 others); Tue, 20 Mar 2018 07:06:58 -0400 Received: from mail.cn.fujitsu.com ([183.91.158.132]:4898 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752850AbeCTLFW (ORCPT ); Tue, 20 Mar 2018 07:05:22 -0400 X-IronPort-AV: E=Sophos;i="5.43,368,1503331200"; d="scan'208";a="38002755" Received: from bogon (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 20 Mar 2018 19:05:18 +0800 Received: from G08CNEXCHPEKD02.g08.fujitsu.local (unknown [10.167.33.83]) by cn.fujitsu.com (Postfix) with ESMTP id A18A448AE76A; Tue, 20 Mar 2018 19:05:16 +0800 (CST) Received: from localhost.localdomain (10.167.226.106) by G08CNEXCHPEKD02.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.361.1; Tue, 20 Mar 2018 19:05:15 +0800 From: Dou Liyang To: , , , CC: , , , , , , , Dou Liyang Subject: [PATCH 5/5] acpi/processor: Make the acpi_duplicate_processor_id() static Date: Tue, 20 Mar 2018 19:04:32 +0800 Message-ID: <20180320110432.28127-6-douly.fnst@cn.fujitsu.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180320110432.28127-1-douly.fnst@cn.fujitsu.com> References: <20180320110432.28127-1-douly.fnst@cn.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.167.226.106] X-yoursite-MailScanner-ID: A18A448AE76A.A1A72 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: douly.fnst@cn.fujitsu.com X-Spam-Status: No Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The acpi_duplicate_processor_id() is only called in acpi_processor_get_info(), So move it in front of acpi_processor_get_info() and make it static. Signed-off-by: Dou Liyang --- drivers/acpi/acpi_processor.c | 62 +++++++++++++++++++++---------------------- include/linux/acpi.h | 3 --- 2 files changed, 31 insertions(+), 34 deletions(-) diff --git a/drivers/acpi/acpi_processor.c b/drivers/acpi/acpi_processor.c index db5bdb59639c..03ec7690710c 100644 --- a/drivers/acpi/acpi_processor.c +++ b/drivers/acpi/acpi_processor.c @@ -229,6 +229,37 @@ static inline int acpi_processor_hotadd_init(struct acpi_processor *pr) } #endif /* CONFIG_ACPI_HOTPLUG_CPU */ +/* The number of the unique processor IDs */ +static int nr_unique_ids __initdata; + +/* The number of the duplicate processor IDs */ +static int nr_duplicate_ids; + +/* Used to store the unique processor IDs */ +static int unique_processor_ids[] __initdata = { + [0 ... NR_CPUS - 1] = -1, +}; + +/* Used to store the duplicate processor IDs */ +static int duplicate_processor_ids[] = { + [0 ... NR_CPUS - 1] = -1, +}; + +static bool acpi_duplicate_processor_id(int proc_id) +{ + int i; + + /* + * Compare the proc_id with duplicate IDs, if the proc_id is already + * in the duplicate IDs, return true, otherwise, return false. + */ + for (i = 0; i < nr_duplicate_ids; i++) { + if (duplicate_processor_ids[i] == proc_id) + return true; + } + return false; +} + static int acpi_processor_get_info(struct acpi_device *device) { union acpi_object object = { 0 }; @@ -579,22 +610,6 @@ static struct acpi_scan_handler processor_container_handler = { .attach = acpi_processor_container_attach, }; -/* The number of the unique processor IDs */ -static int nr_unique_ids __initdata; - -/* The number of the duplicate processor IDs */ -static int nr_duplicate_ids; - -/* Used to store the unique processor IDs */ -static int unique_processor_ids[] __initdata = { - [0 ... NR_CPUS - 1] = -1, -}; - -/* Used to store the duplicate processor IDs */ -static int duplicate_processor_ids[] = { - [0 ... NR_CPUS - 1] = -1, -}; - static void __init processor_validated_ids_update(int proc_id) { int i; @@ -682,21 +697,6 @@ static void __init acpi_processor_check_duplicates(void) NULL, NULL); } -bool acpi_duplicate_processor_id(int proc_id) -{ - int i; - - /* - * compare the proc_id with duplicate IDs, if the proc_id is already - * in the duplicate IDs, return true, otherwise, return false. - */ - for (i = 0; i < nr_duplicate_ids; i++) { - if (duplicate_processor_ids[i] == proc_id) - return true; - } - return false; -} - void __init acpi_processor_init(void) { acpi_processor_check_duplicates(); diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 968173ec2726..dd4591dc1eb3 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -285,9 +285,6 @@ static inline bool invalid_phys_cpuid(phys_cpuid_t phys_id) return phys_id == PHYS_CPUID_INVALID; } -/* Validate the processor object's proc_id */ -bool acpi_duplicate_processor_id(int proc_id); - #ifdef CONFIG_ACPI_HOTPLUG_CPU /* Arch dependent functions for cpu hotplug support */ int acpi_map_cpu(acpi_handle handle, phys_cpuid_t physid, u32 acpi_id, -- 2.14.3