From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH v3 12/24] xen/arm: Release IRQ routed to a domain when it's destroying Date: Tue, 03 Mar 2015 12:50:52 +0000 Message-ID: <54F5AE2C.8050504@linaro.org> References: <1421159133-31526-1-git-send-email-julien.grall@linaro.org> <1421159133-31526-13-git-send-email-julien.grall@linaro.org> <1424449912.30924.346.camel@citrix.com> <54E771C7.4000003@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" 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 1YSmHn-0004yE-K8 for xen-devel@lists.xenproject.org; Tue, 03 Mar 2015 12:50:55 +0000 Received: by wesp10 with SMTP id p10so37425661wes.12 for ; Tue, 03 Mar 2015 04:50:54 -0800 (PST) In-Reply-To: <54E771C7.4000003@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: Ian Campbell Cc: xen-devel@lists.xenproject.org, tim@xen.org, stefano.stabellini@citrix.com List-Id: xen-devel@lists.xenproject.org Hi Ian, On 20/02/2015 17:41, Julien Grall wrote: >>> + /* Only SPIs are supported */ >>> + if ( virq < 32 || virq >= vgic_num_irqs(d) ) >>> + return -EINVAL; >>> + >>> + p = irq_to_pending(d->vcpu[0], virq); >>> + if ( !p->desc ) >>> + return -EINVAL; >> >> Are we seeing this pattern a lot? It seems so, I wonder if a helper >> could be useful: >> p = spi_to_pending(d, virq); >> if ( !p->desc ) >> return -EINVAL; >> >> with the < 32 check etc in the helper where it only needs commenting on >> once. > > IIRC, there is only 2 places. I will replace it by an helper. Hmmmm.... I only found 1 place. So I will keep open-coding in the function. Regards, -- Julien Grall