qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 11/15] bitmap: add a generic bitmap and bitop


From: Corentin Chary
Subject: Re: [Qemu-devel] [PATCH v2 11/15] bitmap: add a generic bitmap and bitops library
Date: Thu, 11 Nov 2010 22:25:35 +0100

On Thu, Nov 11, 2010 at 8:07 PM, Blue Swirl <address@hidden> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]