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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 6 Oct 2022 12:45:41 +0000
From:   Sakari Ailus <sakari.ailus@...ux.intel.com>
To:     Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc:     linux-acpi@...r.kernel.org, linux-kernel@...r.kernel.org,
        Daniel Scally <djrscally@...il.com>,
        Heikki Krogerus <heikki.krogerus@...ux.intel.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        "Rafael J. Wysocki" <rafael@...nel.org>
Subject: Re: [PATCH v1 1/1] device property: Fix documentation for
 *_match_string() APIs

Hi Andy,

On Thu, Oct 06, 2022 at 03:38:07PM +0300, Andy Shevchenko wrote:
> The returned value on success is an index of the matching string,
> starting from 0. Reflect this in the documentation.
> 
> Fixes: 3f5c8d318785 ("device property: Add fwnode_property_match_string()")
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> ---
>  drivers/base/property.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/base/property.c b/drivers/base/property.c
> index 617007a25783..bfed224c5724 100644
> --- a/drivers/base/property.c
> +++ b/drivers/base/property.c
> @@ -236,7 +236,7 @@ EXPORT_SYMBOL_GPL(device_property_read_string);
>   * Find a given string in a string array and if it is found return the
>   * index back.
>   *
> - * Return: %0 if the property was found (success),
> + * Return: index, starting from %0, if the property was found (success),
>   *	   %-EINVAL if given arguments are not valid,
>   *	   %-ENODATA if the property does not have a value,
>   *	   %-EPROTO if the property is not an array of strings,

There are other error codes that can be returned such as -ENOMEM or what
else may be returned by fwnode_property_read_string_array().

I might just refer to fwnode_property_read_string_array() and document here
those specific to these functions.

Just FYI... I guess this could be a separate patch, too.

Reviewed-by: Sakari Ailus <sakari.ailus@...ux.intel.com>

> @@ -457,7 +457,7 @@ EXPORT_SYMBOL_GPL(fwnode_property_read_string);
>   * Find a given string in a string array and if it is found return the
>   * index back.
>   *
> - * Return: %0 if the property was found (success),
> + * Return: index, starting from %0, if the property was found (success),
>   *	   %-EINVAL if given arguments are not valid,
>   *	   %-ENODATA if the property does not have a value,
>   *	   %-EPROTO if the property is not an array of strings,

-- 
Kind regards,

Sakari Ailus

Powered by blists - more mailing lists