On Thu, Nov 11, 2010 at 8:07 PM, Blue Swirl <blauwir...@gmail.com> wrote: > Please don't use identifiers starting with underscore.
Ok, I think __bitmap_* could become slow__bitmap_* (because they are the slow path) > We already have ffs() in qemu-common.h and oslib-win32.c. Please use > the same method. > This is not a standard ffs, this is the ffs used in the kernel, where I stealed all those bitop functions. std ffs: return the position of the first bit set, or 0 if no bits are set in i. kernel ffs: Undefined if no bit exists, so code should check against 0 first. __ffs(0): 31 ffs(0): 0 __ffs(1): 0 ffs(1): 1 This behavior is needed for all the other function to work (and makes more sense that the normal ffs). But .. maybe I should just use ffs() - 1 -- Corentin Chary http://xf.iksaif.net