From: Dou Liyang <douly.fnst@cn.fujitsu.com>
To: <linux-kernel@vger.kernel.org>, <x86@kernel.org>,
<linux-acpi@vger.kernel.org>, <linux-doc@vger.kernel.org>
Cc: <tglx@linutronix.de>, <mingo@redhat.com>, <corbet@lwn.net>,
<rjw@rjwysocki.net>, <lenb@kernel.org>, <hpa@zytor.com>,
<peterz@infradead.org>, Dou Liyang <douly.fnst@cn.fujitsu.com>
Subject: [PATCH 5/5] acpi/processor: Make the acpi_duplicate_processor_id() static
Date: Tue, 20 Mar 2018 19:04:32 +0800 [thread overview]
Message-ID: <20180320110432.28127-6-douly.fnst@cn.fujitsu.com> (raw)
In-Reply-To: <20180320110432.28127-1-douly.fnst@cn.fujitsu.com>
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 <douly.fnst@cn.fujitsu.com>
---
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
prev parent reply other threads:[~2018-03-20 11:06 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-20 11:04 [PATCH 0/5] x86/cpu_hotplug: one bug fix and four cleanup Dou Liyang
2018-03-20 11:04 ` [PATCH 1/5] x86/smpboot: Add the missing description of possible_cpus Dou Liyang
2018-03-20 12:37 ` Peter Zijlstra
2018-03-21 5:33 ` Dou Liyang
2018-03-21 9:08 ` Peter Zijlstra
2018-03-21 9:34 ` Dou Liyang
2018-03-21 9:41 ` Dou Liyang
2018-03-21 9:41 ` Thomas Gleixner
2018-03-20 11:04 ` [PATCH 2/5] x86/cpu_hotplug: Update the link of cpu_hotplug.rst Dou Liyang
2018-03-20 11:04 ` [PATCH 3/5] x86/smpboot: Make the check code more clear in prefill_possible_map() Dou Liyang
2018-03-20 12:39 ` Peter Zijlstra
2018-03-21 5:38 ` Dou Liyang
2018-03-20 11:04 ` [PATCH 4/5] acpi/processor: Fix the return value of acpi_processor_ids_walk() Dou Liyang
2018-05-19 15:06 ` Thomas Gleixner
2018-05-22 1:47 ` Dou Liyang
2018-05-23 1:34 ` Dou Liyang
2018-05-23 8:08 ` Rafael J. Wysocki
2018-03-20 11:04 ` Dou Liyang [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180320110432.28127-6-douly.fnst@cn.fujitsu.com \
--to=douly.fnst@cn.fujitsu.com \
--cc=corbet@lwn.net \
--cc=hpa@zytor.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rjw@rjwysocki.net \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®