From: Bjorn Helgaas Date: Mon, 7 Dec 2020 19:55:06 +0000 (-0600) Subject: PCI: Simplify pci_pio_to_address() X-Git-Tag: v6.6-rc1~122^2^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3b59ca944687b8651849f51b15c23e3fdbf07394;p=thirdparty%2Fkernel%2Flinux.git 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 Reviewed-by: Ilpo Järvinen --- diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 60230da957e0c..4d2b11c71e621 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);