path: root/lib
diff options
authorAndy Shevchenko <>2021-06-30 18:56:10 -0700
committerLinus Torvalds <>2021-07-01 11:06:05 -0700
commit4c52729377eab025b238caeed48994a39c3b73f2 (patch)
treeb6dec8bbe9f71a7690ae5aa0b8c09b33e686ebf4 /lib
parentce71efd03916ea8fe45e9ef6bd6abe4c20734a57 (diff)
kernel.h: split out kstrtox() and simple_strtox() to a separate header
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. [ fix documentation references] Link: Link: Signed-off-by: Andy Shevchenko <> Acked-by: Jonathan Cameron <> Cc: Francis Laniel <> Cc: Randy Dunlap <> Cc: Kars Mulder <> Cc: Trond Myklebust <> Cc: Anna Schumaker <> Cc: "J. Bruce Fields" <> Cc: Chuck Lever <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
Diffstat (limited to 'lib')
2 files changed, 4 insertions, 2 deletions
diff --git a/lib/kstrtox.c b/lib/kstrtox.c
index a118b0b1e9b2..a0cc8dcf4a35 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 f1a6d90b8c34..bcb23484100e 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>