lkml.org 
[lkml]   [2015]   [Mar]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v9 02/21] ACPI / processor: Introduce phys_cpuid_t for CPU hardware ID
From
On Thu, Mar 5, 2015 at 8:44 AM, Hanjun Guo <guohanjun@huawei.com> 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


\
 
 \ /
  Last update: 2015-03-05 14:41    [W:0.088 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site