From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753262AbbEMGja (ORCPT ); Wed, 13 May 2015 02:39:30 -0400 Received: from mail-pd0-f174.google.com ([209.85.192.174]:35215 "EHLO mail-pd0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752813AbbEMGj1 (ORCPT ); Wed, 13 May 2015 02:39:27 -0400 Message-ID: <5552F198.4030304@linaro.org> Date: Wed, 13 May 2015 14:39:20 +0800 From: Hanjun Guo User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Lorenzo Pieralisi CC: Sudeep Holla , "Rafael J. Wysocki" , Will Deacon , Catalin Marinas , Boris Ostrovsky , Stefano Stabellini , "linux-acpi@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linaro-acpi@lists.linaro.org" Subject: Re: [PATCH v2 7/7] ACPI / processor: Introduce invalid_phys_cpuid() References: <1430793998-21631-1-git-send-email-hanjun.guo@linaro.org> <1430793998-21631-8-git-send-email-hanjun.guo@linaro.org> <5548A8C5.1080406@arm.com> <5548C219.9060100@linaro.org> <20150511163542.GB2942@red-moon> In-Reply-To: <20150511163542.GB2942@red-moon> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2015年05月12日 00:35, Lorenzo Pieralisi wrote: > On Tue, May 05, 2015 at 02:14:01PM +0100, Hanjun Guo wrote: >> On 2015???05???05??? 19:25, Sudeep Holla wrote: >>> >>> >>> On 05/05/15 03:46, Hanjun Guo wrote: >>>> Introduce invalid_phys_cpuid() to identify cpu with invalid >>>> physical ID, then used it as replacement of the direct comparisons >>>> with PHYS_CPUID_INVALID. >>>> >>>> Signed-off-by: Hanjun Guo >>>> --- >>>> drivers/acpi/acpi_processor.c | 4 ++-- >>>> drivers/acpi/processor_core.c | 4 ++-- >>>> include/linux/acpi.h | 5 +++++ >>>> 3 files changed, 9 insertions(+), 4 deletions(-) >>>> >>>> diff --git a/drivers/acpi/acpi_processor.c >>>> b/drivers/acpi/acpi_processor.c >>>> index 62c846b..92a5f73 100644 >>>> --- a/drivers/acpi/acpi_processor.c >>> >>> [...] >>> >>>> diff --git a/include/linux/acpi.h b/include/linux/acpi.h >>>> index 913b49f..cc82ff3 100644 >>>> --- a/include/linux/acpi.h >>>> +++ b/include/linux/acpi.h >>>> @@ -163,6 +163,11 @@ static inline bool invalid_logical_cpuid(u32 cpuid) >>>> return (int)cpuid < 0; >>>> } >>>> >>>> +static inline bool invalid_phys_cpuid(phys_cpuid_t phys_id) >>>> +{ >>>> + return (int)phys_id < 0; >>> >>> Should this be phys_id == PHYS_CPUID_INVALID ? else I don't see why we >>> need to even define PHYS_CPUID_INVALID >> >> I'm OK with this. For now, CPU phys_id will be valid value or >> PHYS_CPUID_INVALID in all cases for ACPI processor driver, but >> I want ask Rafael's opinion on this, is it OK to you too, Rafael? > > Is your worry related to functions returning error values > other than PHYS_CPUID_INVALID (when they are expected to return a > physical id) ? Yes. > Is there any in the current kernel ? No such returns as far as I know. > > static inline bool invalid_phys_cpuid(phys_cpuid_t phys_id) > { > return phys_id == PHYS_CPUID_INVALID; > } > > This should do, and if we need more mapping functions that are supposed > to return physical ids they should return PHYS_CPUID_INVALID on failure. OK, I will send a update version for this patch only. Thanks Hanjun