It makes sense. I managed to mix things up. Should we add documentation that 
"cpu" parameter is typically coming from odp_cpumask_first().

-Petri

> -----Original Message-----
> From: ext Robbie King (robking) [mailto:[email protected]]
> Sent: Tuesday, January 13, 2015 5:23 PM
> To: Savolainen, Petri (NSN - FI/Espoo); [email protected]
> Subject: RE: [lng-odp] [PATCHv2 1/2] Convert linux thread/proc helpers to
> use core mask
> 
> Hey Petri, I think it needs to be there at least the way I am currently
> using it.  You begin the process by calling "odp_cpumask_first" to get
> your starting CPU, and the "next" function is the continuation.  So
> the CPU number passed into the function is assumed to be the previously
> set CPU, and we are searching for the next one.  So the "+1" is necessary
> to skip over the CPU passed in (else you would just keep finding the
> same CPU).
> 
> If you wanted to only use "odp_cpumask_next", I think it could be
> done with passing in "-1" as the CPU to indicate start versus
> continuation.
> 
> Hope this makes sense.
> 
> > +int odp_cpumask_next(const odp_cpumask_t *mask, int cpu)
> > +{
> > +   for (cpu += 1; cpu < CPU_SETSIZE; cpu++)
> 
> 
> First valid cpu ID is 0. So, "cpu += 1" should not be there, right?
> 
> -Petri
> 
> 
> > +           if (odp_cpumask_isset(mask, cpu))
> > +                   return cpu;
> > +   return -1;
> > +}
_______________________________________________
lng-odp mailing list
[email protected]
http://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to