Skip to content

Commit 3b59ca9

Browse files
committed
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/20230824193712.542167-8-helgaas@kernel.org Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
1 parent 95881c8 commit 3b59ca9

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

drivers/pci/pci.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4191,16 +4191,12 @@ int pci_register_io_range(struct fwnode_handle *fwnode, phys_addr_t addr,
41914191

41924192
phys_addr_t pci_pio_to_address(unsigned long pio)
41934193
{
4194-
phys_addr_t address = (phys_addr_t)OF_BAD_ADDR;
4195-
41964194
#ifdef PCI_IOBASE
4197-
if (pio >= MMIO_UPPER_LIMIT)
4198-
return address;
4199-
4200-
address = logic_pio_to_hwaddr(pio);
4195+
if (pio < MMIO_UPPER_LIMIT)
4196+
return logic_pio_to_hwaddr(pio);
42014197
#endif
42024198

4203-
return address;
4199+
return (phys_addr_t) OF_BAD_ADDR;
42044200
}
42054201
EXPORT_SYMBOL_GPL(pci_pio_to_address);
42064202

0 commit comments

Comments
 (0)