On 9 June 2014 22:42, Preeti U Murthy preeti@linux.vnet.ibm.com wrote:
+#define for_each_active_base(_index, _base, _cpu_base, _active_bases) \
for ((_active_bases) = (_cpu_base)->active_bases; \
(_index) = ffs(_active_bases), \
(_base) = (_cpu_base)->clock_base + (_index) - 1, (_index); \
(_active_bases) &= ~(1 << ((_index) - 1)))
Shouldn't the index = ffs().. and _base = (cpu_base).. come in the third part of the for loop. These two statements must get executed during each loop iteration along with the negation of the appropriate bit of _active_bases right?
_index is used for conditional check of for loop and so must be done in second part only..
_base will be used by the body of for loop and so that must stay as well in the second part. Only the active_bases were required to be cleared after the body has gone through a iteration and so is present in third part.