From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755226AbbCENYA (ORCPT ); Thu, 5 Mar 2015 08:24:00 -0500 Received: from mail-ob0-f181.google.com ([209.85.214.181]:36084 "EHLO mail-ob0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752740AbbCENX5 (ORCPT ); Thu, 5 Mar 2015 08:23:57 -0500 MIME-Version: 1.0 In-Reply-To: <54F8095C.4030308@huawei.com> 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> Date: Thu, 5 Mar 2015 14:23:56 +0100 X-Google-Sender-Auth: pFKHgBPbC9styxREgRuEH9sW-Dw Message-ID: Subject: Re: [PATCH v9 02/21] ACPI / processor: Introduce phys_cpuid_t for CPU hardware ID From: "Rafael J. Wysocki" To: Hanjun Guo 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 , suravee.suthikulpanit@amd.com, ACPI Devel Maling List , "linux-arm-kernel@lists.infradead.org" , Linux Kernel Mailing List , "linaro-acpi@lists.linaro.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Rafael