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

Re: [Xen-devel] [PATCH 04/29] libxc/bitops: Add or() to the available bitmap operations



On Wed, 2014-09-10 at 18:10 +0100, Andrew Cooper wrote:
> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>

There's a bit of a trap here for callers wrt needing to make sure they
are the same size (or at least both larger than nr_bits), but I think we
can live with that.

> CC: Ian Campbell <Ian.Campbell@xxxxxxxxxx>
> CC: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
> ---
>  tools/libxc/xc_bitops.h |    8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/tools/libxc/xc_bitops.h b/tools/libxc/xc_bitops.h
> index d8e0c16..dfce3b8 100644
> --- a/tools/libxc/xc_bitops.h
> +++ b/tools/libxc/xc_bitops.h
> @@ -60,4 +60,12 @@ static inline int test_and_set_bit(int nr, unsigned long 
> *addr)
>      return oldbit;
>  }
>  
> +static inline void bitmap_or(unsigned long *dst, const unsigned long *other,
> +                             int nr_bits)
> +{
> +    int i, nr_longs = (bitmap_size(nr_bits) / sizeof(unsigned long));

Ah, this doesn't round down because bitnmap_size already rounds up.
Good.

Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.