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]
Message-ID: <9839952.QQZMlEqdiM@vostro.rjw.lan>
Date:	Sat, 09 Jan 2016 00:33:17 +0100
From:	"Rafael J. Wysocki" <rjw@...ysocki.net>
To:	Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc:	Tejun Heo <tj@...nel.org>,
	Linus Walleij <linus.walleij@...aro.org>,
	Dmitry Eremin-Solenikov <dbaryshkov@...il.com>,
	linux-kernel@...r.kernel.org, linux-pm@...r.kernel.org,
	"David S . Miller" <davem@...emloft.net>,
	David Airlie <airlied@...ux.ie>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Rasmus Villemoes <linux@...musvillemoes.dk>
Subject: Re: [PATCH v3 2/9] device property: convert to use match_string() helper

On Friday, January 08, 2016 03:09:11 PM Andy Shevchenko wrote:
> The new helper returns index of the mathing string in an array. We would use it
> here.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> Reviewed-by: Mika Westerberg <mika.westerberg@...ux.intel.com>

Acked-by: Rafael J. Wysocki <rafael.j.wysocki@...el.com>

in case you need that.

I think though that it might be more efficient to simply push [1/9] first
maybe with one user and then send the other patches to the relevant maintainers
when that has been applied.

> ---
>  drivers/base/property.c | 10 ++--------
>  1 file changed, 2 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/base/property.c b/drivers/base/property.c
> index c359351..f902b55 100644
> --- a/drivers/base/property.c
> +++ b/drivers/base/property.c
> @@ -647,7 +647,7 @@ int fwnode_property_match_string(struct fwnode_handle *fwnode,
>  	const char *propname, const char *string)
>  {
>  	const char **values;
> -	int nval, ret, i;
> +	int nval, ret;
>  
>  	nval = fwnode_property_read_string_array(fwnode, propname, NULL, 0);
>  	if (nval < 0)
> @@ -664,13 +664,7 @@ int fwnode_property_match_string(struct fwnode_handle *fwnode,
>  	if (ret < 0)
>  		goto out;
>  
> -	ret = -ENODATA;
> -	for (i = 0; i < nval; i++) {
> -		if (!strcmp(values[i], string)) {
> -			ret = i;
> -			break;
> -		}
> -	}
> +	ret = match_string(values, nval, string);
>  out:
>  	kfree(values);
>  	return ret;
> 

-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ