[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v18 05/10] xbitmap: add more operations
From: |
Tetsuo Handa |
Subject: |
Re: [Qemu-devel] [PATCH v18 05/10] xbitmap: add more operations |
Date: |
Sun, 3 Dec 2017 10:50:42 +0900 |
Matthew Wilcox wrote:
> On Fri, Dec 01, 2017 at 03:09:08PM +0000, Wang, Wei W wrote:
> > On Friday, December 1, 2017 9:02 PM, Tetsuo Handa wrote:
> > > If start == end is legal,
> > >
> > > for (; start < end; start = (start | (IDA_BITMAP_BITS - 1)) + 1) {
> > >
> > > makes this loop do nothing because 10 < 10 is false.
> >
> > How about "start <= end "?
>
> Don't ask Tetsuo for his opinion, write some userspace code that uses it.
>
Please be sure to prepare for "end == -1UL" case, for "start < end" will become
true when "start = (start | (IDA_BITMAP_BITS - 1)) + 1" made "start == 0" due to
overflow.
Re: [Qemu-devel] [PATCH v18 05/10] xbitmap: add more operations, Matthew Wilcox, 2017/12/01