From: Ian Campbell Subject: Re: [PATCH] xen/arm: pass a struct pending_irq* as parameter to gic helper functions Date: Thu, 19 Dec 2013 13:50:38 +0000 Message-ID: <1387461038.9925.77.camel@kazak.uk.xensource.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: 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.xensource.com List-Id: xen-devel@lists.xenproject.org On Tue, 2013-12-17 at 16:16 +0000, Stefano Stabellini wrote: > gic_add_to_lr_pending and gic_set_lr should take a struct pending_irq* > as parameter instead of the virtual_irq number and the priority > separately and doing yet another irq_to_pending lookup. > > Signed-off-by: Stefano Stabellini Acked-by: Ian Campbell What do you think about this one for 4.4? It whiffs a bit of a cleanup rather than a bug fix (unless e.g. there is some subtle incorrectness in the priority which was getting passed around before, rather than just the potential for it) > @@ -672,12 +670,12 @@ void gic_set_guest_irq(struct vcpu *v, unsigned int virtual_irq, > i = find_first_zero_bit(&this_cpu(lr_mask), nr_lrs); > if (i < nr_lrs) { > set_bit(i, &this_cpu(lr_mask)); > - gic_set_lr(i, virtual_irq, state, priority); > + gic_set_lr(i, irq_to_pending(v, virtual_irq), state); > goto out; > } > } > > - gic_add_to_lr_pending(v, virtual_irq, priority); > + gic_add_to_lr_pending(v, irq_to_pending(v, virtual_irq)); I think you could take this one step further and make a similar change to gic_set_guest_irq, the only caller has the pending_irq * in its hand already. Ian.