[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] get rid of private bitmap functions in block/sh
Re: [Qemu-devel] [PATCH] get rid of private bitmap functions in block/sheepdog.c, use generic ones
Tue, 15 Mar 2011 14:09:11 +0900
On Thu, Mar 10, 2011 at 11:03 PM, Michael Tokarev <address@hidden> 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 <address@hidden>
Looks good. Thanks!
Acked-by: MORITA Kazutaka <address@hidden>