On Fri, 21 Nov, at 03:19:52PM, Thomas Gleixner wrote:
> > +           barrier();
> > +           cqe_genable = true;
> 
> What's the exact point of that barrier?
 
Yes, this definitely needs documenting. Vikas?

> > +
> > +/*
> > + * Tests if only contiguous bits are set.
> > + */
> > +
> > +static inline bool cbm_iscontiguous(unsigned long var)
> > +{
> 
> This one here can be implemented with existing bitmap functions as
> well.

Something like this?

        first_bit = find_next_bit(map, nr_bits, -1);
        zero_bit = find_next_zero_bit(map, nr_bits, first_bit);

        if (find_next_bit(map, nr_bits, zero_bit) < nr_bits)
                return -EINVAL; /* non-contiguous bits */

-- 
Matt Fleming, Intel Open Source Technology Center
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to