From: "Jan Beulich" Subject: Re: [PATCH] only use legitimate shift counts in bitmap shifting Date: Wed, 23 Apr 2014 10:11:09 +0100 Message-ID: <53579FCD020000780000B392@nat28.tlf.novell.com> References: <53577EC9020000780000B223@nat28.tlf.novell.com> <1398243675.4880.112.camel@kazak.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WctCz-0007MC-BN for xen-devel@lists.xenproject.org; Wed, 23 Apr 2014 09:11:13 +0000 In-Reply-To: <1398243675.4880.112.camel@kazak.uk.xensource.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell Cc: xen-devel , Keir Fraser , Ian Jackson , Tim Deegan List-Id: xen-devel@lists.xenproject.org >>> On 23.04.14 at 11:01, wrote: > On Wed, 2014-04-23 at 07:50 +0100, Jan Beulich wrote: >> An alternative would be to remove these implicitly unused functions. > > Why "implicitly"? Because they have users (cpumask shifts), but those users are themselves unused. > Looks like we got this file from Linux, which I suppose is a reason to > keep it intact even if we aren't using these particular functions. It > does look like the same fix applies to Linux though. > > Can you be explicit about which thing is illegitimate? I have inferred > it is when rem == 0, which leads to "upper << BITS_PER_LONG"? If you > make that clear in the commit message then: > Acked-by: Ian Campbell Thanks - added For rem being zero (where rem is the remainder of a division by BITS_PER_LONG, "upper << (BITS_PER_LONG - rem)" degenerates to "upper << BITS_PER_LONG", which is undefined. despite thinking that this just describes the obvious. Jan