From: Tim Deegan Subject: Re: [PATCH] bitmap_*() should cope with zero size bitmaps Date: Mon, 3 Jun 2013 17:12:25 +0100 Message-ID: <20130603161225.GD16240@ocelot.phlegethon.org> References: <51ACB74402000078000DA8F0@nat28.tlf.novell.com> <20130603154043.GC16240@ocelot.phlegethon.org> <51ACD81D02000078000DAA75@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <51ACD81D02000078000DAA75@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: Keir Fraser , xen-devel List-Id: xen-devel@lists.xenproject.org At 16:53 +0100 on 03 Jun (1370278413), Jan Beulich wrote: > >>> On 03.06.13 at 17:40, Tim Deegan wrote: > > At 14:33 +0100 on 03 Jun (1370270004), Jan Beulich wrote: > >> +#define find_next_bit(addr, size, off) ({ \ > >> + unsigned int r__ = (size); \ > >> + unsigned int o__ = (off); \ > >> + switch ( -!__builtin_constant_p(size) | r__ ) \ > > > > Mmmm, binary trickery. :) But doesn't leave us with the old behaviour > > in cases where 'size' is a non-compile-time-constant zero? > > Intentionally (and not just for zero - the compile time constant zero > case was what was broken after all) Ah, I see -- the non-constant case was already OK. Sorry for the noise. Tim.