@@ -1191,8 +1191,7 @@ int pci_alloc_irq_vectors_affinity(struct pci_dev *dev, unsigned int min_vecs,
1191
1191
struct irq_affinity * affd )
1192
1192
{
1193
1193
struct irq_affinity msi_default_affd = {0 };
1194
- int msix_vecs = - ENOSPC ;
1195
- int msi_vecs = - ENOSPC ;
1194
+ int nvecs = - ENOSPC ;
1196
1195
1197
1196
if (flags & PCI_IRQ_AFFINITY ) {
1198
1197
if (!affd )
@@ -1203,17 +1202,16 @@ int pci_alloc_irq_vectors_affinity(struct pci_dev *dev, unsigned int min_vecs,
1203
1202
}
1204
1203
1205
1204
if (flags & PCI_IRQ_MSIX ) {
1206
- msix_vecs = __pci_enable_msix_range (dev , NULL , min_vecs ,
1207
- max_vecs , affd , flags );
1208
- if (msix_vecs > 0 )
1209
- return msix_vecs ;
1205
+ nvecs = __pci_enable_msix_range (dev , NULL , min_vecs , max_vecs ,
1206
+ affd , flags );
1207
+ if (nvecs > 0 )
1208
+ return nvecs ;
1210
1209
}
1211
1210
1212
1211
if (flags & PCI_IRQ_MSI ) {
1213
- msi_vecs = __pci_enable_msi_range (dev , min_vecs , max_vecs ,
1214
- affd );
1215
- if (msi_vecs > 0 )
1216
- return msi_vecs ;
1212
+ nvecs = __pci_enable_msi_range (dev , min_vecs , max_vecs , affd );
1213
+ if (nvecs > 0 )
1214
+ return nvecs ;
1217
1215
}
1218
1216
1219
1217
/* use legacy IRQ if allowed */
@@ -1231,9 +1229,7 @@ int pci_alloc_irq_vectors_affinity(struct pci_dev *dev, unsigned int min_vecs,
1231
1229
}
1232
1230
}
1233
1231
1234
- if (msix_vecs == - ENOSPC )
1235
- return - ENOSPC ;
1236
- return msi_vecs ;
1232
+ return nvecs ;
1237
1233
}
1238
1234
EXPORT_SYMBOL (pci_alloc_irq_vectors_affinity );
1239
1235
0 commit comments