lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 11 Apr 2019 16:02:33 +0300
From:   Heikki Krogerus <heikki.krogerus@...ux.intel.com>
To:     "Rafael J. Wysocki" <rjw@...ysocki.net>
Cc:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Hans de Goede <hdegoede@...hat.com>,
        Darren Hart <dvhart@...radead.org>,
        Andy Shevchenko <andy@...radead.org>,
        linux-acpi@...r.kernel.org, linux-kernel@...r.kernel.org,
        platform-driver-x86@...r.kernel.org
Subject: Re: [PATCH v2 06/12] ACPI / property: Don't limit named child node
 matching to data nodes

Hi Rafael,

On Wed, Apr 10, 2019 at 06:24:59PM +0300, Heikki Krogerus wrote:
> There is no reason why we should limit the use of
> fwnode_get_named_child_node() to data nodes only.
> 
> Signed-off-by: Heikki Krogerus <heikki.krogerus@...ux.intel.com>
> ---
>  drivers/acpi/property.c | 26 ++++++++++++++++++++------
>  1 file changed, 20 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/acpi/property.c b/drivers/acpi/property.c
> index 77abe0ec4043..c3fb52c387a6 100644
> --- a/drivers/acpi/property.c
> +++ b/drivers/acpi/property.c
> @@ -602,15 +602,29 @@ 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;
>  
> -	/*
> -	 * Find first matching named child node of this fwnode.
> -	 * For ACPI this will be a data only sub-node.
> -	 */
> -	fwnode_for_each_child_node(fwnode, child)
> -		if (acpi_data_node_match(child, childname))
> +	path.length = sizeof(name);
> +	path.pointer = name;
> +
> +	fwnode_for_each_child_node(fwnode, child) {
> +		if (is_acpi_data_node(child)) {
> +			if (acpi_data_node_match(child, childname))
> +				return child;
> +			continue;
> +		}
> +
> +		status = acpi_get_name(ACPI_HANDLE_FWNODE(child),
> +				       ACPI_SINGLE_NAME, &path);
> +		if (ACPI_FAILURE(status))
> +			break;
> +
> +		if (!strncmp(name, childname, ACPI_NAME_SIZE))

I rebased these on of todays linux-next, and noticed that Bob renamed
ACPI_NAME_SIZE to ACPI_NAMESEG_SIZE in commit 3278675567df ("ACPICA:
Rename nameseg length macro/define for clarity").

I'll fix that and resend these tomorrow.

thanks,

-- 
heikki

Powered by blists - more mailing lists