On Tue, Aug 07, 2018 at 04:21:15PM +0800, Wei Wang wrote: > On 08/07/2018 03:39 PM, Peter Xu wrote: > > On Tue, Jul 31, 2018 at 06:01:18PM +0800, Wei Wang wrote: > > > When "nbits = 0", which means no bits to mask, this macro is expected to > > > return 0, instead of 0xffffffff. This patch changes the macro to return > > > 0 when there is no bit needs to be masked. > > > > > > Signed-off-by: Wei Wang <wei.w.w...@intel.com> > > > CC: Juan Quintela <quint...@redhat.com> > > > CC: Dr. David Alan Gilbert <dgilb...@redhat.com> > > > CC: Peter Xu <pet...@redhat.com> > > Reviewed-by: Peter Xu <pet...@redhat.com> > > > > Is there any existing path that can trigger this nbits==0? > > Not sure about other bitmap APIs which call this macro. But it happens in > the patches we are working on, which use bitmap_count_one. > It would be good to have the macro itself handle this corner case, so that > callers won't need to worry about that.
Yeah that makes sense. Asked since that would matter on whether it's 3.0 material, then it's possibly not. Regards, -- Peter Xu