All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ACPI / property: use cached name in acpi_fwnode_get_named_child_node()
@ 2020-06-09 13:22 Heikki Krogerus
  2020-06-22 15:46 ` Rafael J. Wysocki
  0 siblings, 1 reply; 2+ messages in thread
From: Heikki Krogerus @ 2020-06-09 13:22 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: linux-acpi

There is no need to re-evaluate the object name.

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
---
 drivers/acpi/property.c | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/drivers/acpi/property.c b/drivers/acpi/property.c
index e601c4511a8b5..6941062272e0b 100644
--- a/drivers/acpi/property.c
+++ b/drivers/acpi/property.c
@@ -606,13 +606,7 @@ static struct fwnode_handle *
 acpi_fwnode_get_named_child_node(const struct fwnode_handle *fwnode,
 				 const char *childname)
 {
-	char name[ACPI_PATH_SEGMENT_LENGTH];
 	struct fwnode_handle *child;
-	struct acpi_buffer path;
-	acpi_status status;
-
-	path.length = sizeof(name);
-	path.pointer = name;
 
 	fwnode_for_each_child_node(fwnode, child) {
 		if (is_acpi_data_node(child)) {
@@ -621,12 +615,8 @@ acpi_fwnode_get_named_child_node(const struct fwnode_handle *fwnode,
 			continue;
 		}
 
-		status = acpi_get_name(ACPI_HANDLE_FWNODE(child),
-				       ACPI_SINGLE_NAME, &path);
-		if (ACPI_FAILURE(status))
-			break;
-
-		if (!strncmp(name, childname, ACPI_NAMESEG_SIZE))
+		if (!strncmp(acpi_device_bid(to_acpi_device_node(child)),
+			     childname, ACPI_NAMESEG_SIZE))
 			return child;
 	}
 
-- 
2.27.0.rc2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ACPI / property: use cached name in acpi_fwnode_get_named_child_node()
  2020-06-09 13:22 [PATCH] ACPI / property: use cached name in acpi_fwnode_get_named_child_node() Heikki Krogerus
@ 2020-06-22 15:46 ` Rafael J. Wysocki
  0 siblings, 0 replies; 2+ messages in thread
From: Rafael J. Wysocki @ 2020-06-22 15:46 UTC (permalink / raw)
  To: Heikki Krogerus; +Cc: linux-acpi

On Tuesday, June 9, 2020 3:22:39 PM CEST Heikki Krogerus wrote:
> There is no need to re-evaluate the object name.
> 
> Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> ---
>  drivers/acpi/property.c | 14 ++------------
>  1 file changed, 2 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/acpi/property.c b/drivers/acpi/property.c
> index e601c4511a8b5..6941062272e0b 100644
> --- a/drivers/acpi/property.c
> +++ b/drivers/acpi/property.c
> @@ -606,13 +606,7 @@ static struct fwnode_handle *
>  acpi_fwnode_get_named_child_node(const struct fwnode_handle *fwnode,
>  				 const char *childname)
>  {
> -	char name[ACPI_PATH_SEGMENT_LENGTH];
>  	struct fwnode_handle *child;
> -	struct acpi_buffer path;
> -	acpi_status status;
> -
> -	path.length = sizeof(name);
> -	path.pointer = name;
>  
>  	fwnode_for_each_child_node(fwnode, child) {
>  		if (is_acpi_data_node(child)) {
> @@ -621,12 +615,8 @@ acpi_fwnode_get_named_child_node(const struct fwnode_handle *fwnode,
>  			continue;
>  		}
>  
> -		status = acpi_get_name(ACPI_HANDLE_FWNODE(child),
> -				       ACPI_SINGLE_NAME, &path);
> -		if (ACPI_FAILURE(status))
> -			break;
> -
> -		if (!strncmp(name, childname, ACPI_NAMESEG_SIZE))
> +		if (!strncmp(acpi_device_bid(to_acpi_device_node(child)),
> +			     childname, ACPI_NAMESEG_SIZE))
>  			return child;
>  	}
>  
> 

Applied as 5.9 material, thanks!





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-06-22 15:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-09 13:22 [PATCH] ACPI / property: use cached name in acpi_fwnode_get_named_child_node() Heikki Krogerus
2020-06-22 15:46 ` Rafael J. Wysocki

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.