From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH v3 11/24] xen/arm: Let the toolstack configure the number of SPIs Date: Mon, 23 Feb 2015 15:48:19 +0000 Message-ID: <54EB4BC3.20104@linaro.org> 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> <1424704945.27930.157.camel@citrix.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 1YPvFY-0005X2-JV for xen-devel@lists.xenproject.org; Mon, 23 Feb 2015 15:48:48 +0000 Received: by wesw62 with SMTP id w62so19304420wes.9 for ; Mon, 23 Feb 2015 07:48:47 -0800 (PST) In-Reply-To: <1424704945.27930.157.camel@citrix.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: Ian Campbell 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 Hi Ian, On 23/02/15 15:22, Ian Campbell wrote: > 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. I will move the (irq - 32) after the check for safety. Regards, -- Julien Grall