genirq/msi: Make interrupt allocation less convoluted
There is no real reason to do several loops over the MSI descriptors instead of just doing one loop. In case of an error everything is undone anyway so it does not matter whether it's a partial or a full rollback. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Tested-by: Michael Kelley <mikelley@microsoft.com> Tested-by: Nishanth Menon <nm@ti.com> Reviewed-by: Jason Gunthorpe <jgg@nvidia.com> Link: https://lore.kernel.org/r/20211206210749.010234767@linutronix.de
This commit is contained in:
parent
a80713fea3
commit
ef8dd01538
3 changed files with 69 additions and 67 deletions
|
|
@ -206,12 +206,6 @@ struct msi_desc *msi_next_desc(struct device *dev, enum msi_desc_filter filter);
|
|||
list_for_each_entry((desc), dev_to_msi_list((dev)), list)
|
||||
#define for_each_msi_entry_safe(desc, tmp, dev) \
|
||||
list_for_each_entry_safe((desc), (tmp), dev_to_msi_list((dev)), list)
|
||||
#define for_each_msi_vector(desc, __irq, dev) \
|
||||
for_each_msi_entry((desc), (dev)) \
|
||||
if ((desc)->irq) \
|
||||
for (__irq = (desc)->irq; \
|
||||
__irq < ((desc)->irq + (desc)->nvec_used); \
|
||||
__irq++)
|
||||
|
||||
#ifdef CONFIG_IRQ_MSI_IOMMU
|
||||
static inline const void *msi_desc_get_iommu_cookie(struct msi_desc *desc)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue