Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1298183
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 3/3] IDE-ACPI: Move an assignment for one variable in ide_get_dev_handle() |
| Date | 2015-12-26 11:30 +0100 |
| Message-ID | <qJUgO-869-9@gated-at.bofh.it> (permalink) |
| References | <qEuGl-43C-5@gated-at.bofh.it> <qJU78-82O-5@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: Markus Elfring <elfring@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 <elfring@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 majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 0/3] IDE-ACPI: Fine-tuning for a function SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-26 11:20 +0100
[PATCH 2/3] IDE-ACPI: Delete unnecessary null pointer checks in ide_get_dev_handle() SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-26 11:20 +0100
[PATCH 1/3] IDE-ACPI: One function call less in ide_get_dev_handle() after error detection SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-26 11:20 +0100
[PATCH 3/3] IDE-ACPI: Move an assignment for one variable in ide_get_dev_handle() SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-26 11:30 +0100
Re: [PATCH 0/3] IDE-ACPI: Fine-tuning for a function David Miller <davem@davemloft.net> - 2015-12-26 19:20 +0100
Re: [PATCH 0/3] IDE-ACPI: Fine-tuning for a function Joe Perches <joe@perches.com> - 2015-12-27 00:50 +0100
Re: [PATCH 0/3] IDE-ACPI: Fine-tuning for a function Julia Lawall <julia.lawall@lip6.fr> - 2015-12-27 07:10 +0100
csiph-web