Skip to content

Commit

Permalink
PCI: Simplify pci_pio_to_address()
Browse files Browse the repository at this point in the history
Simplify pci_pio_to_address() by removing an unnecessary local variable.
No functional change intended.

Link: https://lore.kernel.org/r/20230824193712.542167-8-helgaas@kernel.org
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
  • Loading branch information
Bjorn Helgaas committed Aug 25, 2023
1 parent 95881c8 commit 3b59ca9
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions drivers/pci/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -4191,16 +4191,12 @@ int pci_register_io_range(struct fwnode_handle *fwnode, phys_addr_t addr,

phys_addr_t pci_pio_to_address(unsigned long pio)
{
phys_addr_t address = (phys_addr_t)OF_BAD_ADDR;

#ifdef PCI_IOBASE
if (pio >= MMIO_UPPER_LIMIT)
return address;

address = logic_pio_to_hwaddr(pio);
if (pio < MMIO_UPPER_LIMIT)
return logic_pio_to_hwaddr(pio);
#endif

return address;
return (phys_addr_t) OF_BAD_ADDR;
}
EXPORT_SYMBOL_GPL(pci_pio_to_address);

Expand Down

0 comments on commit 3b59ca9

Please sign in to comment.