+ kernelh-update-comment-about-simple_strtofoo-functions.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: kernel.h: update comment about simple_strto<foo>() functions
has been added to the -mm tree.  Its filename is
     kernelh-update-comment-about-simple_strtofoo-functions.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/kernelh-update-comment-about-simple_strtofoo-functions.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/kernelh-update-comment-about-simple_strtofoo-functions.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
Subject: kernel.h: update comment about simple_strto<foo>() functions

There were discussions in the past about use cases for simple_strto<foo>()
functions and, in some rare cases, they have a benefit over kstrto<foo>()
ones.

Update a comment to reduce confusion about special use cases.

Link: http://lkml.kernel.org/r/20190801192904.41087-1-andriy.shevchenko@xxxxxxxxxxxxxxx
Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
Suggested-by: Miguel Ojeda <miguel.ojeda.sandonis@xxxxxxxxx>
Cc: Geert Uytterhoeven <geert+renesas@xxxxxxxxx>
Cc: Mans Rullgard <mans@xxxxxxxxx>
Cc: Petr Mladek <pmladek@xxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 include/linux/kernel.h |   19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

--- a/include/linux/kernel.h~kernelh-update-comment-about-simple_strtofoo-functions
+++ a/include/linux/kernel.h
@@ -355,8 +355,7 @@ int __must_check kstrtoll(const char *s,
  * @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.
+ * Used as a replacement for the simple_strtoull. Return code must be checked.
 */
 static inline int __must_check kstrtoul(const char *s, unsigned int base, unsigned long *res)
 {
@@ -384,8 +383,7 @@ static inline int __must_check kstrtoul(
  * @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.
+ * Used as a replacement for the simple_strtoull. Return code must be checked.
  */
 static inline int __must_check kstrtol(const char *s, unsigned int base, long *res)
 {
@@ -461,7 +459,18 @@ static inline int __must_check kstrtos32
 	return kstrtoint_from_user(s, count, base, res);
 }
 
-/* Obsolete, do not use.  Use kstrto<foo> instead */
+/*
+ * Use kstrto<foo> instead.
+ *
+ * NOTE: simple_strto<foo> does not check for the range overflow and,
+ *	 depending on the input, may give interesting results.
+ *
+ * Use these functions if and only if you cannot use kstrto<foo>, because
+ * the conversion ends on the first non-digit character, which may be far
+ * beyond the supported range. It might be useful to parse the strings like
+ * 10x50 or 12:21 without altering original string or temporary buffer in use.
+ * Keep in mind above caveat.
+ */
 
 extern unsigned long simple_strtoul(const char *,char **,unsigned int);
 extern long simple_strtol(const char *,char **,unsigned int);
_

Patches currently in -mm which might be from andriy.shevchenko@xxxxxxxxxxxxxxx are

lib-test_bitmap-force-argument-of-bitmap_parselist_user-to-proper-address-space.patch
lib-test_bitmap-undefine-macros-after-use.patch
lib-test_bitmap-name-exp_bytes-properly.patch
lib-test_bitmap-rename-exp-to-exp1-to-avoid-ambiguous-name.patch
lib-test_bitmap-move-exp1-and-exp2-upper-for-others-to-use.patch
lib-test_bitmap-fix-comment-about-this-file.patch
bitmap-introduce-bitmap_replace-helper.patch
gpio-pca953x-remove-redundant-variable-and-check-in-irq-handler.patch
gpio-pca953x-use-input-from-regs-structure-in-pca953x_irq_pending.patch
gpio-pca953x-convert-to-use-bitmap-api.patch
gpio-pca953x-convert-to-use-bitmap-api-fix.patch
gpio-pca953x-tight-up-indentation.patch
kernelh-update-comment-about-simple_strtofoo-functions.patch
auxdisplay-charlcd-deduplicate-simple_strtoul.patch




[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux