> +/* > + * Fill in *pme, *aer, *dpc with the relevant Interrupt Message Numbers if > + * services are enabled in "mask". Return the number of MSI/MSI-X vectors > + * required to accommodate the largest Message Number. > + */ > +static int pcie_message_numbers(struct pci_dev *dev, int mask, > + u32 *pme, u32 *aer, u32 *dpc) > +{ Can you split factoring out this helper into a separate clean up patch that goes before the actual change? Otherwise this looks fine: Reviewed-by: Christoph Hellwig <hch@xxxxxx> Note that we should probably replace the irqs array with one storing the relative vector number and use pci_request_irq(). In fact in that case we could probably just pass said array to pcie_message_numbers() to further simplify it.