summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2021-06-30 18:56:10 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-06-21 15:45:35 +0200
commit6e2e551e39fddda9a6c3385115368578c01d570e (patch)
tree7b3b08104bcfd68b35fa325f4dde2aeaa134fbdb /lib
parentc2def5578b440f6ac45fcffcf766d968d7c3bea5 (diff)
downloadlinux-stable-6e2e551e39fddda9a6c3385115368578c01d570e.tar.gz
linux-stable-6e2e551e39fddda9a6c3385115368578c01d570e.tar.bz2
linux-stable-6e2e551e39fddda9a6c3385115368578c01d570e.zip
kernel.h: split out kstrtox() and simple_strtox() to a separate header
[ Upstream commit 4c52729377eab025b238caeed48994a39c3b73f2 ] kernel.h is being used as a dump for all kinds of stuff for a long time. Here is the attempt to start cleaning it up by splitting out kstrtox() and simple_strtox() helpers. At the same time convert users in header and lib folders to use new header. Though for time being include new header back to kernel.h to avoid twisted indirected includes for existing users. [andy.shevchenko@gmail.com: fix documentation references] Link: https://lkml.kernel.org/r/20210615220003.377901-1-andy.shevchenko@gmail.com Link: https://lkml.kernel.org/r/20210611185815.44103-1-andriy.shevchenko@linux.intel.com Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Cc: Francis Laniel <laniel_francis@privacyrequired.com> Cc: Randy Dunlap <rdunlap@infradead.org> Cc: Kars Mulder <kerneldev@karsmulder.nl> Cc: Trond Myklebust <trond.myklebust@hammerspace.com> Cc: Anna Schumaker <anna.schumaker@netapp.com> Cc: "J. Bruce Fields" <bfields@fieldses.org> Cc: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Stable-dep-of: 4acfe3dfde68 ("test_firmware: prevent race conditions by a correct implementation of locking") Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/kstrtox.c5
-rw-r--r--lib/parser.c1
2 files changed, 4 insertions, 2 deletions
diff --git a/lib/kstrtox.c b/lib/kstrtox.c
index 8504526541c1..53fa01fb7509 100644
--- a/lib/kstrtox.c
+++ b/lib/kstrtox.c
@@ -14,11 +14,12 @@
*/
#include <linux/ctype.h>
#include <linux/errno.h>
-#include <linux/kernel.h>
-#include <linux/math64.h>
#include <linux/export.h>
+#include <linux/kstrtox.h>
+#include <linux/math64.h>
#include <linux/types.h>
#include <linux/uaccess.h>
+
#include "kstrtox.h"
const char *_parse_integer_fixup_radix(const char *s, unsigned int *base)
diff --git a/lib/parser.c b/lib/parser.c
index f5b3e5d7a7f9..5c37d6345cb0 100644
--- a/lib/parser.c
+++ b/lib/parser.c
@@ -6,6 +6,7 @@
#include <linux/ctype.h>
#include <linux/types.h>
#include <linux/export.h>
+#include <linux/kstrtox.h>
#include <linux/parser.h>
#include <linux/slab.h>
#include <linux/string.h>