From: Markus Elfring <elfr...@users.sourceforge.net>
Date: Sat, 26 Dec 2015 10:50:33 +0100

Move the assignment for the variable "addr" to the statement
where its value is used after previous function calls succeeded.

Signed-off-by: Markus Elfring <elfr...@users.sourceforge.net>
---
 drivers/ide/ide-acpi.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/ide/ide-acpi.c b/drivers/ide/ide-acpi.c
index b6b2111..c2de9f9 100644
--- a/drivers/ide/ide-acpi.c
+++ b/drivers/ide/ide-acpi.c
@@ -132,9 +132,6 @@ static int ide_get_dev_handle(struct device *dev, 
acpi_handle *handle,
        bus = pdev->bus->number;
        devnum = PCI_SLOT(pdev->devfn);
        func = PCI_FUNC(pdev->devfn);
-       /* ACPI _ADR encoding for PCI bus: */
-       addr = (u64)(devnum << 16 | func);
-
        DEBPRINT("ENTER: pci %02x:%02x.%01x\n", bus, devnum, func);
 
        dev_handle = ACPI_HANDLE(dev);
@@ -148,6 +145,8 @@ static int ide_get_dev_handle(struct device *dev, 
acpi_handle *handle,
                DEBPRINT("get_object_info for device failed\n");
                return -ENODEV;
        }
+       /* ACPI _ADR encoding for PCI bus: */
+       addr = (u64)(devnum << 16 | func);
        if ((dinfo->valid & ACPI_VALID_ADR) &&
            dinfo->address == addr) {
                *pcidevfn = addr;
-- 
2.6.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to