Skip to contentSkip to conversation

ACPI: PCI: simplify code with acpi_get_local_u64_address()

PATCH Applied Andy Shevchenko 3 participants 4 messages Jan 21 – Jan 23

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 ACPI: PCI: simplify code with acpi_get_local_u64_address()

Now we have a helper so there's no need to open-code.

---

v2: fixed a typo (LKP)

 drivers/acpi/pci_slot.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/acpi/pci_slot.c +5 -5
index 741bcc9d6d6a..15234b65ea22 100644
@@ -42,8 +42,9 @@ static int
 check_slot(acpi_handle handle, unsigned long long *sun)
 {
 	int device = -1;
-	unsigned long long adr, sta;
+	unsigned long long sta;
 	acpi_status status;
+	u64 adr;
 	struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
 
 	acpi_get_name(handle, ACPI_FULL_PATHNAME, &buffer);
@@ -56,10 +57,9 @@ check_slot(acpi_handle handle, unsigned long long *sun)
 			goto out;
 	}
 
-	status = acpi_evaluate_integer(handle, "_ADR", NULL, &adr);
-	if (ACPI_FAILURE(status)) {
-		pr_debug("_ADR returned %d on %s\n",
-			 status, (char *)buffer.pointer);
+	if (acpi_get_local_u64_address(handle, &adr)) {
+		pr_debug("_ADR returned with failure on %s\n",
+			 (char *)buffer.pointer);
 		goto out;
 	}
 
Signature · 1 line
2.50.1
Reviewed-by on v2 1/1
#1 lore raw
Quoted 3 lines · Andy Shevchenko

Now we have a helper so there's no need to open-code.

Looks like most drivers/acpi commits capitalize the subject line, e.g., s/simplify/Simplify/

Quoted 39 lines

---

v2: fixed a typo (LKP)

 drivers/acpi/pci_slot.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/acpi/pci_slot.c +5 -5
index 741bcc9d6d6a..15234b65ea22 100644
@@ -42,8 +42,9 @@ static int
 check_slot(acpi_handle handle, unsigned long long *sun)
 {
 	int device = -1;
-	unsigned long long adr, sta;
+	unsigned long long sta;
 	acpi_status status;
+	u64 adr;
 	struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
 
 	acpi_get_name(handle, ACPI_FULL_PATHNAME, &buffer);
@@ -56,10 +57,9 @@ check_slot(acpi_handle handle, unsigned long long *sun)
 			goto out;
 	}
 
-	status = acpi_evaluate_integer(handle, "_ADR", NULL, &adr);
-	if (ACPI_FAILURE(status)) {
-		pr_debug("_ADR returned %d on %s\n",
-			 status, (char *)buffer.pointer);
+	if (acpi_get_local_u64_address(handle, &adr)) {
+		pr_debug("_ADR returned with failure on %s\n",
+			 (char *)buffer.pointer);
 		goto out;
 	}
 
Signature · 1 line
2.50.1
#2 lore raw
Quoted 6 lines · Bjorn Helgaas
Quoted 3 lines · Andy Shevchenko

Now we have a helper so there's no need to open-code.

Thank you!

Quoted 2 lines

Looks like most drivers/acpi commits capitalize the subject line, e.g., s/simplify/Simplify/

Unless Rafael wants this to be done I would leave it for now as is, but I will try to remember this for the future contributions, thanks!

Signature · 2 lines
With Best Regards,
Andy Shevchenko
maintainer Applied
#3 lore raw
Quoted 10 lines · Andy Shevchenko
Quoted 6 lines · Bjorn Helgaas
Quoted 3 lines · Andy Shevchenko

Now we have a helper so there's no need to open-code.

Thank you!

Applied, thanks!

Quoted 4 lines
Quoted 2 lines

Looks like most drivers/acpi commits capitalize the subject line, e.g., s/simplify/Simplify/

Unless Rafael wants this to be done I would leave it for now as is,

I don't think it matters that much ...

Quoted 1 line

but I will try to remember this for the future contributions, thanks!

... but consistency will be appreciated. Thanks!