lkml.org 
[lkml]   [2012]   [Jun]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] x86/apic: Eliminate cpu_mask_to_apicid() operation
On Mon, Jun 11, 2012 at 10:22:49AM +0200, Ingo Molnar wrote:
> > @@ -2151,7 +2134,12 @@ int default_cpu_mask_to_apicid_and(const struct cpumask *cpumask,
> > break;
> > }
> >
> > - return __default_cpu_to_apicid(cpu, apicid);
> > + if (likely((unsigned int)cpu < nr_cpu_ids)) {
> > + *apicid = per_cpu(x86_cpu_to_apicid, cpu);
> > + return 0;
> > + } else {
> > + return -EINVAL;
> > + }
>
> The type cast is rather ugly - why not change the cpu type to
> unsigned int?

Tried to preserve in changelog as much original code as possible.
Suppose, it has been int to match cpumask_* functions.

> Also, the else block is superfluous, just make it a return
> -EINVAL?

What about posting a separate patch, with the rest of apic drivers that have
the same branch/cast fixed, altogether?

>
> Thanks,
>
> Ingo

--
Regards,
Alexander Gordeev
agordeev@redhat.com


\
 
 \ /
  Last update: 2012-06-11 13:22    [W:0.062 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site