Skip to contentSkip to conversation

ACPI: acpica: Constify pathname argument for acpi_get_handle()

PATCH In review Sakari Ailus 2 participants 4 messages Dec 20, 2022 – Jan 2, 2023

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

PATCH 1/1 ACPI: acpica: Constify pathname argument for acpi_get_handle()

acpi_get_handle() uses the pathname argument to find a handle related to that pathname but it does not need to modify it. Make it const, in order to be able to pass const pathname to it.

---
 drivers/acpi/acpica/nsxfname.c | 2 +-
 include/acpi/acpixf.h          | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/acpi/acpica/nsxfname.c +1 -1
index b2cfdfef31947..a0592d15dd37c 100644
@@ -44,7 +44,7 @@ static char *acpi_ns_copy_device_id(struct acpi_pnp_device_id *dest,
 
 acpi_status
 acpi_get_handle(acpi_handle parent,
-		acpi_string pathname, acpi_handle *ret_handle)
+		const char *pathname, acpi_handle *ret_handle)
 {
 	acpi_status status;
 	struct acpi_namespace_node *node = NULL;
include/acpi/acpixf.h +1 -1
index 67c0b9e734b64..085f23d833349 100644
@@ -526,7 +526,7 @@ ACPI_EXTERNAL_RETURN_STATUS(acpi_status
 					   struct acpi_buffer *ret_path_ptr))
 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
 			     acpi_get_handle(acpi_handle parent,
-					     acpi_string pathname,
+					     const char *pathname,
 					     acpi_handle *ret_handle))
 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
 			     acpi_attach_data(acpi_handle object,
Signature · 1 line
2.30.2
#1 lore raw
Quoted 31 lines · Sakari Ailus

acpi_get_handle() uses the pathname argument to find a handle related to that pathname but it does not need to modify it. Make it const, in order to be able to pass const pathname to it.

---
 drivers/acpi/acpica/nsxfname.c | 2 +-
 include/acpi/acpixf.h          | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/acpi/acpica/nsxfname.c +1 -1
index b2cfdfef31947..a0592d15dd37c 100644
@@ -44,7 +44,7 @@ static char *acpi_ns_copy_device_id(struct acpi_pnp_device_id *dest,
 
 acpi_status
 acpi_get_handle(acpi_handle parent,
-               acpi_string pathname, acpi_handle *ret_handle)
+               const char *pathname, acpi_handle *ret_handle)
 {
        acpi_status status;
        struct acpi_namespace_node *node = NULL;
include/acpi/acpixf.h +0 -0
index 67c0b9e734b64..085f23d833349 100644

include/acpi/acpixf.h ACPI_EXTERNAL_RETURN_STATUS(acpi_status

Quoted 9 lines
include/acpi/acpixf.h +1 -2
@@ -526,7 +526,7 @@ ACPI_EXTERNAL_RETURN_STATUS(acpi_status
                                           struct acpi_buffer *ret_path_ptr))
 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
                             acpi_get_handle(acpi_handle parent,
-                                            acpi_string pathname,
+                                            const char *pathname,
                                             acpi_handle *ret_handle))
 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
                             acpi_attach_data(acpi_handle object,
--

I'll queue up this one for 6.3 early next week, thanks!

#2 lore raw
Quoted 37 lines · Rafael J. Wysocki
Quoted 34 lines · Sakari Ailus

acpi_get_handle() uses the pathname argument to find a handle related to that pathname but it does not need to modify it. Make it const, in order to be able to pass const pathname to it.

---
 drivers/acpi/acpica/nsxfname.c | 2 +-
 include/acpi/acpixf.h          | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/acpi/acpica/nsxfname.c +1 -1
index b2cfdfef31947..a0592d15dd37c 100644
@@ -44,7 +44,7 @@ static char *acpi_ns_copy_device_id(struct acpi_pnp_device_id *dest,
 
 acpi_status
 acpi_get_handle(acpi_handle parent,
-               acpi_string pathname, acpi_handle *ret_handle)
+               const char *pathname, acpi_handle *ret_handle)
 {
        acpi_status status;
        struct acpi_namespace_node *node = NULL;
include/acpi/acpixf.h +0 -0
index 67c0b9e734b64..085f23d833349 100644
@@ -526,7 +526,7 @@ ACPI_EXTERNAL_RETURN_STATUS(acpi_status
                                           struct acpi_buffer *ret_path_ptr))
 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
                             acpi_get_handle(acpi_handle parent,
Quoted 8 lines

include/acpi/acpixf.h ACPI_EXTERNAL_RETURN_STATUS(acpi_status

Quoted 6 lines
include/acpi/acpixf.h +1 -2
-                                            acpi_string pathname,
+                                            const char *pathname,
                                             acpi_handle *ret_handle))
 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
                             acpi_attach_data(acpi_handle object,
--

I'll queue up this one for 6.3 early next week, thanks!

Applied now, thanks!

#3 lore raw
Quoted 1 line · Rafael J. Wysocki

Applied now, thanks!

Thank you, Rafael!

Signature · 1 line
Sakari Ailus