On Thu, Mar 10, 2011 at 11:03 PM, Michael Tokarev <m...@tls.msk.ru> wrote: > qemu now has generic bitmap functions, > so don't redefine them in sheepdog.c, > use common header instead. A small cleanup. > > Here's only one function which is actually > used in sheepdog and gets replaced with > a generic one (simplified): > > - static inline int test_bit(int nr, const volatile unsigned long *addr) > + static inline int test_bit(int nr, const unsigned long *addr) > { > - return ((1UL << (nr % BITS_PER_LONG)) > & ((unsigned long*)addr)[nr / BITS_PER_LONG])) != 0; > + return 1UL & (addr[nr / BITS_PER_LONG] >> (nr & (BITS_PER_LONG-1))); > } > > The body is equivalent, but the argument is not: there's > "volatile" in there. Why it is used for - I'm not sure. > > Signed-off-by: Michael Tokarev <m...@tls.msk.ru>
Looks good. Thanks! Acked-by: MORITA Kazutaka <morita.kazut...@lab.ntt.co.jp>