From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751390AbdB1Fye (ORCPT ); Tue, 28 Feb 2017 00:54:34 -0500 Received: from cn.fujitsu.com ([59.151.112.132]:35144 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1750712AbdB1Fyc (ORCPT ); Tue, 28 Feb 2017 00:54:32 -0500 X-IronPort-AV: E=Sophos;i="5.22,518,1449504000"; d="scan'208";a="16036076" From: Dou Liyang To: , , , , , CC: , , Dou Liyang Subject: [PATCH] x86/acpi: Fix a warning message in logical CPU IDs allocation Date: Tue, 28 Feb 2017 13:50:52 +0800 Message-ID: <1488261052-25753-1-git-send-email-douly.fnst@cn.fujitsu.com> X-Mailer: git-send-email 2.5.5 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.167.226.106] X-yoursite-MailScanner-ID: CC62342B4B03.AFC68 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: douly.fnst@cn.fujitsu.com Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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