On 02/04/2013 11:26 AM, Richard Henderson wrote: > Similar to the bitops_ctz change just made. > > Signed-off-by: Richard Henderson <r...@twiddle.net> > --- > include/qemu/bitops.h | 44 +++++++++++++++----------------------------- > target-i386/topology.h | 2 +- > util/bitops.c | 2 +- > 3 files changed, 17 insertions(+), 31 deletions(-)
Reviewed-by: Eric Blake <ebl...@redhat.com> > > diff --git a/include/qemu/bitops.h b/include/qemu/bitops.h > index 8b88791..07ada63 100644 > --- a/include/qemu/bitops.h > +++ b/include/qemu/bitops.h > @@ -50,41 +50,27 @@ static unsigned long bitops_ctzl(unsigned long word) > } > > /** > - * bitops_fls - find last (most-significant) set bit in a long word > + * bitops_clzl - find last (most-significant) set bit in a long word > * @word: the word to search > * > * Undefined if no set bit exists, so code should check against 0 first. Interesting that you chose to leave 0 undefined here, even though bitops_ctzl specifically defines that case, but not a show-stopper. Per Paolo's arguments in the other thread, if we did decide to define bitops_clzl(0), setting it to the word size would be a reasonable choice (bitops_clzl(2)=>62, bitops_clzl(1)=>63, bitops_clzl(0)=>64), but that can be done later if it turns out to be useful. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature