Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1589194

[PATCH] x86/acpi: Fix a warning message in logical CPU IDs allocation

From Dou Liyang <douly.fnst@cn.fujitsu.com>
Newsgroups linux.kernel
Subject [PATCH] x86/acpi: Fix a warning message in logical CPU IDs allocation
Date 2017-02-28 07:00 +0100
Message-ID <tfIZj-68-5@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


Current warning message regarded the "nr_cpu_ids - 1" as the limit
number of the CPUs. It may be confused us, for example:
we have two CPUs, nr_cpu_ids = 2, but the warning message may
indicate that we just have 1 CPU, which likes that:
    Only 1 processors supported.Processor 2/0x2 and the rest
    are ignored.

Fix the warning message, replace "nr_cpu_ids - 1" with "nr_cpu_ids".
And the warning message can be like that:
    APIC: NR_CPUS/possible_cpus limit of 2 reached. Processor 2/0x2
    and the rest are ignored.

Signed-off-by: Dou Liyang <douly.fnst@cn.fujitsu.com>
---
 arch/x86/kernel/apic/apic.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index 8567c85..fcdd15e 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -2062,10 +2062,10 @@ static int allocate_logical_cpuid(int apicid)
 
 	/* Allocate a new cpuid. */
 	if (nr_logical_cpuids >= nr_cpu_ids) {
-		WARN_ONCE(1, "Only %d processors supported."
+		WARN_ONCE(1, "APIC: NR_CPUS/possible_cpus limit of %i reached. "
 			     "Processor %d/0x%x and the rest are ignored.\n",
-			     nr_cpu_ids - 1, nr_logical_cpuids, apicid);
-		return -1;
+			     nr_cpu_ids, nr_logical_cpuids, apicid);
+		return -EINVAL;
 	}
 
 	cpuid_to_apicid[nr_logical_cpuids] = apicid;
-- 
2.5.5

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH] x86/acpi: Fix a warning message in logical CPU IDs allocation Dou Liyang <douly.fnst@cn.fujitsu.com> - 2017-02-28 07:00 +0100

csiph-web