From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754253AbbCFGta (ORCPT ); Fri, 6 Mar 2015 01:49:30 -0500 Received: from szxga02-in.huawei.com ([119.145.14.65]:46618 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752924AbbCFGt0 (ORCPT ); Fri, 6 Mar 2015 01:49:26 -0500 Message-ID: <54F94DB0.1000305@huawei.com> Date: Fri, 6 Mar 2015 14:48:16 +0800 From: Hanjun Guo User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.0.1 MIME-Version: 1.0 To: "Rafael J. Wysocki" CC: "Rafael J. Wysocki" , Hanjun Guo , Catalin Marinas , "Will Deacon" , Olof Johansson , Grant Likely , Lorenzo Pieralisi , Arnd Bergmann , Mark Rutland , "Graeme Gregory" , Sudeep Holla , "Jon Masters" , Marc Zyngier , Mark Brown , Robert Richter , Timur Tabi , Ashwin Chaugule , , ACPI Devel Maling List , "linux-arm-kernel@lists.infradead.org" , Linux Kernel Mailing List , "linaro-acpi@lists.linaro.org" Subject: Re: [PATCH v9 02/21] ACPI / processor: Introduce phys_cpuid_t for CPU hardware ID References: <1424853601-6675-1-git-send-email-hanjun.guo@linaro.org> <1424853601-6675-3-git-send-email-hanjun.guo@linaro.org> <1484357.vjmmcyQq4z@vostro.rjw.lan> <54F8095C.4030308@huawei.com> In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.17.188] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2015/3/5 21:23, Rafael J. Wysocki wrote: > On Thu, Mar 5, 2015 at 8:44 AM, Hanjun Guo wrote: >> On 2015/3/5 6:29, Rafael J. Wysocki wrote: >>> On Wednesday, February 25, 2015 04:39:42 PM Hanjun Guo wrote: > [cut] > >>>> @@ -190,7 +190,7 @@ int acpi_map_cpuid(int phys_id, u32 acpi_id) >>>> if (nr_cpu_ids <= 1 && acpi_id == 0) >>>> return acpi_id; >>>> else >>>> - return phys_id; >>>> + return -1; >>> Can we use a proper error code here? >> I'm afraid not. In ACPI processor drivers, -1 will be deemed to >> invalid cpu logical number, if we return error code here, we need >> to modify multi places of "if (cpu_logical_num == -1)" to > Oh, silly stuff. > >> "if (! (cpu_logical_num < 0))" too, so for me, I prefer to keep it as >> -1, but I'm open for suggestions. > OK > > I think we need something like invalid_logical_cpuid() and use it > in all of those checks instead of the direct comparisons, but we > can make those changes later. OK, I recorded this as one of my TODO list, thanks for the suggestions. Thanks Hanjun