From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH v2 04/21] xen/arm: vgic: Introduce a function to initialize pending_irq Date: Wed, 06 Aug 2014 15:52:54 +0100 Message-ID: <53E24146.4030307@linaro.org> References: <1406818852-31856-1-git-send-email-julien.grall@linaro.org> <1406818852-31856-5-git-send-email-julien.grall@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XF2aL-00046K-QM for xen-devel@lists.xenproject.org; Wed, 06 Aug 2014 14:53:04 +0000 Received: by mail-we0-f180.google.com with SMTP id w61so2763636wes.39 for ; Wed, 06 Aug 2014 07:52:59 -0700 (PDT) In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Stefano Stabellini Cc: xen-devel@lists.xenproject.org, tim@xen.org, ian.campbell@citrix.com, stefano.stabellini@citrix.com List-Id: xen-devel@lists.xenproject.org Hi Stefano, On 08/06/2014 03:06 PM, Stefano Stabellini wrote: > On Thu, 31 Jul 2014, Julien Grall wrote: >> The structure pending_irq is initialized on the same way in 2 differents >> place. Introduce vgic_init_pending_irq to avoid code duplication. >> >> Also move the setting of the irq field in this function as we need to >> initialize it once rather than every time an IRQ is injected to the guest. >> >> Signed-off-by: Julien Grall > > > >> Changes in v2: >> - Patch added >> --- >> xen/arch/arm/vgic.c | 19 ++++++++++--------- >> 1 file changed, 10 insertions(+), 9 deletions(-) >> >> diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c >> index ac34437..17cde7a 100644 >> --- a/xen/arch/arm/vgic.c >> +++ b/xen/arch/arm/vgic.c >> @@ -53,6 +53,13 @@ struct vgic_irq_rank *vgic_rank_irq(struct vcpu *v, unsigned int irq) >> return vgic_rank_offset(v, 8, irq, DABT_WORD); >> } >> >> +static void vgic_init_pending_irq(struct pending_irq *p, unsigned virq) >> +{ >> + INIT_LIST_HEAD(&p->inflight); >> + INIT_LIST_HEAD(&p->lr_queue); >> + p->irq = virq; >> +} > > Reading this code made me realize that the irq field in pending_irq is a > signed integer, while virq is unsigned. We should be consistent. I think we should use unsigned int everywhere. As p->irq is only used in gic_dump_info, I will made the p->irq change type in this patch. > In any case this patch is still an improvement over what we have now: > > Acked-by: Stefano Stabellini Can I keep your keep with the p->irq change type? Regards, -- Julien Grall