lkml.org 
[lkml]   [2011]   [Mar]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 12/14] xen: events: remove use of nr_irqs as upper bound on number of pirqs
>  int xen_irq_from_pirq(unsigned pirq)
> {
> - return pirq_to_irq[pirq];
> + int irq;
> +
> + struct irq_info *info;
> +
> + spin_lock(&irq_mapping_update_lock);
> +
> + list_for_each_entry(info, &xen_irq_list_head, list) {
> + if (info == NULL || info->type != IRQT_PIRQ)
> + continue;
> + irq = info->irq;
> + if (info->u.pirq.pirq == pirq)
> + goto out;
> + }
> + irq = -1;
> +out:
> + spin_lock(&irq_mapping_update_lock);
> +
> + return -1;

Shouldn't this be:

return irq

?

How come you are using the spin_lock here, but not
in other places when iterating over the xen_irq_list_head?


\
 
 \ /
  Last update: 2011-03-10 06:37    [W:0.115 / U:0.140 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site