aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjorn Helgaas <[email protected]>2020-12-07 13:55:06 -0600
committerBjorn Helgaas <[email protected]>2023-08-25 08:15:22 -0500
commit3b59ca944687b8651849f51b15c23e3fdbf07394 (patch)
tree49605419f8aadea00aca1576d36e2309d2958405
parent95881c86c987eb73936e5eb3cf93b9b17d137d5a (diff)
PCI: Simplify pci_pio_to_address()
Simplify pci_pio_to_address() by removing an unnecessary local variable. No functional change intended. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bjorn Helgaas <[email protected]> Reviewed-by: Ilpo Järvinen <[email protected]>
-rw-r--r--drivers/pci/pci.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 60230da957e0..4d2b11c71e62 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -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);