[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 3/5] xen/gic: support injecting IRQs even to VCPUs not currently running



On Thu, 2012-06-07 at 13:46 +0100, Tim Deegan wrote:
> At 12:22 +0100 on 06 Jun (1338985328), Stefano Stabellini wrote:
> > +static void gic_restore_pending_irqs(struct vcpu *v)
> > +{
> > +    int i;
> > +    struct pending_irq *p;
> > +
> > +    /* check for new pending irqs */
> > +    if ( list_empty(&v->arch.vgic.lr_pending) )
> > +        return;
> > +
> > +    list_for_each_entry ( p, &v->arch.vgic.lr_pending, lr_queue )

Is list_for_each_entry on an empty list somehow wrong/buggy/slow?

> > +    {
> > +        i = find_first_zero_bit(&gic.lr_mask, nr_lrs);
> > +        if ( i < nr_lrs )
> > +        {
> > +            gic_set_lr(i, p->irq, GICH_LR_PENDING, p->priority);
> > +            list_del_init(&p->lr_queue);
> > +            set_bit(i, &gic.lr_mask);
> > +            if ( p->irq == VGIC_IRQ_EVTCHN_CALLBACK )
> > +                set_bit(i, &gic.event_mask);
> > +        } else
> > +        {
> > +            return;
> > +        }
> 
> This is a bit ugly - maybe "if ( i >= nr_lrs ) return" above and don't
> indent the block?
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.