diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2021-07-29 23:51:52 +0200 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2021-08-10 11:03:29 +0200 |
commit | a6e8b946508cda3c3bf0f9b0e133d293dc9754f6 (patch) | |
tree | 17b1b3d4818bb55dca90593c0c3ad33ea751a2ff /drivers/pci/msi.c | |
parent | 3998527d2e3ee2bfdf710a45b7b90968ff87babc (diff) | |
download | lwn-a6e8b946508cda3c3bf0f9b0e133d293dc9754f6.tar.gz lwn-a6e8b946508cda3c3bf0f9b0e133d293dc9754f6.zip |
PCI/MSI: Simplify msi_verify_entries()
No point in looping over all entries when 64bit addressing mode is enabled
for nothing.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Marc Zyngier <maz@kernel.org>
Reviewed-by: Marc Zyngier <maz@kernel.org>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Link: https://lore.kernel.org/r/20210729222542.992849326@linutronix.de
Diffstat (limited to 'drivers/pci/msi.c')
-rw-r--r-- | drivers/pci/msi.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c index 95e6ce478c04..b59957c021a8 100644 --- a/drivers/pci/msi.c +++ b/drivers/pci/msi.c @@ -613,8 +613,11 @@ static int msi_verify_entries(struct pci_dev *dev) { struct msi_desc *entry; + if (!dev->no_64bit_msi) + return 0; + for_each_pci_msi_entry(entry, dev) { - if (entry->msg.address_hi && dev->no_64bit_msi) { + if (entry->msg.address_hi) { pci_err(dev, "arch assigned 64-bit MSI address %#x%08x but device only supports 32 bits\n", entry->msg.address_hi, entry->msg.address_lo); return -EIO; |