From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH v3 11/24] xen/arm: Let the toolstack configure the number of SPIs Date: Mon, 23 Feb 2015 15:22:25 +0000 Message-ID: <1424704945.27930.157.camel@citrix.com> References: <1421159133-31526-1-git-send-email-julien.grall@linaro.org> <1421159133-31526-12-git-send-email-julien.grall@linaro.org> <1424448515.30924.334.camel@citrix.com> <54E76EF8.30208@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YPuq6-0001Si-Gd for xen-devel@lists.xenproject.org; Mon, 23 Feb 2015 15:22:30 +0000 In-Reply-To: <54E76EF8.30208@linaro.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Julien Grall Cc: Wei Liu , Stefano Stabellini , tim@xen.org, Ian Jackson , stefano.stabellini@citrix.com, Jan Beulich , xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org On Fri, 2015-02-20 at 17:29 +0000, Julien Grall wrote: > On 20/02/15 16:08, Ian Campbell wrote: > > On Wed, 2015-01-28 at 18:26 +0000, Stefano Stabellini wrote: > > > >>> + int spi = irq - 32; > >> > >> unsigned int > > > > and underflow? > > No because there is a check (irq < 32) before using the variable spi. > It was more convenient to initialize it directly. You'd have to be sure that "irq - 32" wasn't undefined behaviour then, or the compiler can decide to omit the rest of the function, or perhaps just that second check, because things are undefined from the initialiser onwards. I think with unsigned you are probably ok. Ian.