lkml.org 
[lkml]   [2018]   [Jun]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH V3 02/17] kallsyms, x86: Export addresses of syscall trampolines
On Wed, Jun 06, 2018 at 11:02:08AM +0300, Adrian Hunter wrote:
> On 05/06/18 19:00, Andi Kleen wrote:
> >> +#ifdef CONFIG_X86_64
> >> +int arch_get_kallsym(unsigned int symnum, unsigned long *value, char *type,
> >> + char *name)
> >> +{
> >> + unsigned int cpu, ncpu;
> >> +
> >> + if (symnum >= num_possible_cpus())
> >> + return -EINVAL;
> >> +
> >> + for (cpu = cpumask_first(cpu_possible_mask), ncpu = 0;
> >> + cpu < num_possible_cpus() && ncpu < symnum;
> >> + cpu = cpumask_next(cpu, cpu_possible_mask), ncpu++)
> >> + ;
> >
> > That is max_t(unsigned, cpumask_last(cpu_possible_mask), symnum)
>
> I think it should be:
>
> - cpu < num_possible_cpus() && ncpu < symnum;
> + ncpu < symnum;

Since we're bike-shedding:

for_each_possible_cpu(cpu) {
if (ncpu++ >= symnum)
break;
}


\
 
 \ /
  Last update: 2018-06-06 12:52    [W:0.046 / U:1.140 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site