On Sun, May 11, 2008 at 06:19:39PM +0200, Alexander van Heukelum wrote:
How about doing it this way?
#define for_each_cpu_mask(cpu, mask) \
for ((cpu) = -1; \
(cpu) < NR_CPUS; \
(cpu) = find_next_cpu_mask((cpu), &(mask)))
int find_next_cpu_mask(int n, const cpumask_t *srcp)
{
return find_next_bit(srcp->bits, NR_CPUS, ++n);
}
That actually behaves the way I'd expect a function called
'find_next_cpu_mask' to work. It also abuses the 'for' condtion
less and might take a little less text space.
--
Intel are signing my paycheques ... these opinions are still mine
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours. We can't possibly take such
a retrograde step."
--