lkml.org 
[lkml]   [2023]   [Aug]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 07/12] PCI: Simplify pci_pio_to_address()
    Date
    From: Bjorn Helgaas <bhelgaas@google.com>

    Simplify pci_pio_to_address() by removing an unnecessary local variable.
    No functional change intended.

    Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
    ---
    drivers/pci/pci.c | 10 +++-------
    1 file 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);

    --
    2.34.1
    \
     
     \ /
      Last update: 2023-08-24 21:40    [W:2.849 / U:0.084 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site