I still think that we need to migrate from embedding code that will go stale as an example to having good real examples and use doxygen to put the desired snippet from them into the documentation.
It looks like the next drive after 1.0 will in part be a push improve the docs, I'd like to fix this then - maybe a we need a bug or @TODO so that we don't forget. On 13 January 2015 at 11:35, Ola Liljedahl <[email protected]> wrote: > On 13 January 2015 at 17:10, Robbie King (robking) <[email protected]> > wrote: > > How about: > > > > /** > > * Find next cpu in mask > > * > > * Finds the next cpu in the CPU mask, starting at the cpu passed. > > * Use with odp_cpumask_first to traverse a CPU mask, i.e. > > * > > * int cpu = odp_cpumask_first(&mask); > > * while (0 <= cpu) { > > * ... > > * ... > > * cpu = odp_cpumask_next(&mask, cpu); > > * } > > * > > * @param mask CPU mask to find next cpu in > > * @param cpu CPU to start from > > * @return cpu found else -1 > > */ > +1 > > > > > -----Original Message----- > > From: Ola Liljedahl [mailto:[email protected]] > > Sent: Tuesday, January 13, 2015 10:58 AM > > To: Robbie King (robking) > > Cc: Savolainen, Petri (NSN - FI/Espoo); [email protected] > > Subject: Re: [lng-odp] [PATCHv2 1/2] Convert linux thread/proc helpers > to use core mask > > > > On 13 January 2015 at 16:35, Robbie King (robking) <[email protected]> > wrote: > >> Yes, that’s a good point. A quick usage blurb would be useful. > > A little code snippet in the header file perhaps? > > > >> > >> -----Original Message----- > >> From: Savolainen, Petri (NSN - FI/Espoo) [mailto: > [email protected]] > >> Sent: Tuesday, January 13, 2015 10:33 AM > >> To: Robbie King (robking); [email protected] > >> Subject: RE: [lng-odp] [PATCHv2 1/2] Convert linux thread/proc helpers > to use core mask > >> > >> 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 > > _______________________________________________ > lng-odp mailing list > [email protected] > http://lists.linaro.org/mailman/listinfo/lng-odp > -- *Mike Holmes* Linaro Sr Technical Manager LNG - ODP
_______________________________________________ lng-odp mailing list [email protected] http://lists.linaro.org/mailman/listinfo/lng-odp
