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] [day] [month] [year] [list]
Message-ID: <20200731085527.GH3703480@smile.fi.intel.com>
Date:   Fri, 31 Jul 2020 11:55:27 +0300
From:   Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To:     Kars Mulder <kerneldev@...smulder.nl>
Cc:     linux-kernel@...r.kernel.org, Eldad Zack <eldad@...refinery.com>,
        Miguel Ojeda <miguel.ojeda.sandonis@...il.com>,
        Geert Uytterhoeven <geert+renesas@...der.be>,
        Mans Rullgard <mans@...sr.com>, Petr Mladek <pmladek@...e.com>,
        Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH 2/2] kstrto*: do not describe simple_strto*() as
 obsolete/replaced

On Fri, Jul 31, 2020 at 12:40:29AM +0200, Kars Mulder wrote:
> The documentation of the kstrto*() functions describes kstrto*() as
> "replacements" of the "obsolete" simple_strto*() functions. Both of
> these terms are inaccurate: they're not replacements because they have
> different behaviour, and the simple_strto*() are not obsolete because
> there are cases where they have benefits over kstrto*().
> 
> Remove usage of the terms "replacement" and "obsolete" in reference
> to simple_strto*(), and instead use the term "preferred over".

Reviewed-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>

> Fixes: 4c925d6031f71 ("kstrto*: add documentation")
> Fixes: 885e68e8b7b13 ("kernel.h: update comment about simple_strto<foo>() functions")
> Signed-off-by: Kars Mulder <kerneldev@...smulder.nl>
> 
> ---
>  include/linux/kernel.h |  4 ++--
>  lib/kstrtox.c          | 12 ++++--------
>  2 files changed, 6 insertions(+), 10 deletions(-)
> 
> diff --git a/include/linux/kernel.h b/include/linux/kernel.h
> index 2d6050f12c64..35fd7e0e3f04 100644
> --- a/include/linux/kernel.h
> +++ b/include/linux/kernel.h
> @@ -346,7 +346,7 @@ int __must_check kstrtoll(const char *s, unsigned int base, long long *res);
>   * @res: Where to write the result of the conversion on success.
>   *
>   * Returns 0 on success, -ERANGE on overflow and -EINVAL on parsing error.
> - * Used as a replacement for the simple_strtoul(). Return code must be checked.
> + * Preferred over simple_strtoul(). Return code must be checked.
>  */
>  static inline int __must_check kstrtoul(const char *s, unsigned int base, unsigned long *res)
>  {
> @@ -374,7 +374,7 @@ static inline int __must_check kstrtoul(const char *s, unsigned int base, unsign
>   * @res: Where to write the result of the conversion on success.
>   *
>   * Returns 0 on success, -ERANGE on overflow and -EINVAL on parsing error.
> - * Used as a replacement for the simple_strtol(). Return code must be checked.
> + * Preferred over simple_strtol(). Return code must be checked.
>   */
>  static inline int __must_check kstrtol(const char *s, unsigned int base, long *res)
>  {
> diff --git a/lib/kstrtox.c b/lib/kstrtox.c
> index 252ac414ba9a..a14ccf905055 100644
> --- a/lib/kstrtox.c
> +++ b/lib/kstrtox.c
> @@ -115,8 +115,7 @@ static int _kstrtoull(const char *s, unsigned int base, unsigned long long *res)
>   * @res: Where to write the result of the conversion on success.
>   *
>   * Returns 0 on success, -ERANGE on overflow and -EINVAL on parsing error.
> - * Used as a replacement for the obsolete simple_strtoull(). Return code must
> - * be checked.
> + * Preferred over simple_strtoull(). Return code must be checked.
>   */
>  int kstrtoull(const char *s, unsigned int base, unsigned long long *res)
>  {
> @@ -139,8 +138,7 @@ EXPORT_SYMBOL(kstrtoull);
>   * @res: Where to write the result of the conversion on success.
>   *
>   * Returns 0 on success, -ERANGE on overflow and -EINVAL on parsing error.
> - * Used as a replacement for the obsolete simple_strtoll(). Return code must
> - * be checked.
> + * Preferred over simple_strtoll(). Return code must be checked.
>   */
>  int kstrtoll(const char *s, unsigned int base, long long *res)
>  {
> @@ -211,8 +209,7 @@ EXPORT_SYMBOL(_kstrtol);
>   * @res: Where to write the result of the conversion on success.
>   *
>   * Returns 0 on success, -ERANGE on overflow and -EINVAL on parsing error.
> - * Used as a replacement for the obsolete simple_strtoul(). Return code must
> - * be checked.
> + * Preferred over simple_strtoul(). Return code must be checked.
>   */
>  int kstrtouint(const char *s, unsigned int base, unsigned int *res)
>  {
> @@ -242,8 +239,7 @@ EXPORT_SYMBOL(kstrtouint);
>   * @res: Where to write the result of the conversion on success.
>   *
>   * Returns 0 on success, -ERANGE on overflow and -EINVAL on parsing error.
> - * Used as a replacement for the obsolete simple_strtol(). Return code must
> - * be checked.
> + * Preferred over simple_strtol(). Return code must be checked.
>   */
>  int kstrtoint(const char *s, unsigned int base, int *res)
>  {
> --
> 2.28.0
> 

-- 
With Best Regards,
Andy Shevchenko


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ