diff --git a/components/drivers/pci/msi/irq.c b/components/drivers/pci/msi/irq.c index 273f5c9bf9..ff49b28188 100644 --- a/components/drivers/pci/msi/irq.c +++ b/components/drivers/pci/msi/irq.c @@ -34,7 +34,7 @@ rt_err_t rt_pci_msi_setup_irqs(struct rt_pci_device *pdev, int nvec, int type) if (type == PCIY_MSI) { - int last_irq = -1; + int last_irq = -1, irq_idx; rt_size_t irq_nr; desc = rt_pci_msi_first_desc(pdev); @@ -74,12 +74,12 @@ rt_err_t rt_pci_msi_setup_irqs(struct rt_pci_device *pdev, int nvec, int type) desc->irq = irq - irq_nr; } - rt_bitmap_for_each_set_bit(msi_irq_map, irq, MAX_HANDLERS) + rt_bitmap_for_each_set_bit(msi_irq_map, irq_idx, MAX_HANDLERS) { - msi_pic->ops->irq_free_msi(msi_pic, irq); + msi_pic->ops->irq_free_msi(msi_pic, irq_idx); /* Free bit so the next user doesn't need to bzero */ - rt_bitmap_clear_bit(msi_irq_map, irq); + rt_bitmap_clear_bit(msi_irq_map, irq_idx); } rt_hw_spin_unlock(&msi_irq_map_lock.lock);