[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <bc3f60f1cde68546363a4bfdab32d19b85892409.1667336095.git.christophe.jaillet@wanadoo.fr>
Date: Tue, 1 Nov 2022 22:14:05 +0100
From: Christophe JAILLET <christophe.jaillet@...adoo.fr>
To: unlisted-recipients:; (no To-header on input)
Cc: linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org,
Christophe JAILLET <christophe.jaillet@...adoo.fr>
Subject: [PATCH 17/30] initramfs: Use kstrtobool() instead of strtobool()
strtobool() is the same as kstrtobool().
However, the latter is more used within the kernel.
In order to remove strtobool() and slightly simplify kstrtox.h, switch to
the other function name.
While at it, include the corresponding header file (<linux/kstrtox.h>)
Signed-off-by: Christophe JAILLET <christophe.jaillet@...adoo.fr>
---
This patch is part of a serie that axes all usages of strtobool().
Each patch can be applied independently from the other ones.
The last patch of the serie removes the definition of strtobool().
You may not be in copy of the cover letter. So, if needed, it is available
at [1].
[1]: https://lore.kernel.org/all/cover.1667336095.git.christophe.jaillet@wanadoo.fr/
---
init/initramfs.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/init/initramfs.c b/init/initramfs.c
index 62321883fe61..174e15236c8e 100644
--- a/init/initramfs.c
+++ b/init/initramfs.c
@@ -11,6 +11,7 @@
#include <linux/syscalls.h>
#include <linux/utime.h>
#include <linux/file.h>
+#include <linux/kstrtox.h>
#include <linux/memblock.h>
#include <linux/mm.h>
#include <linux/namei.h>
@@ -571,7 +572,12 @@ __setup("keepinitrd", keepinitrd_setup);
static bool __initdata initramfs_async = true;
static int __init initramfs_async_setup(char *str)
{
- strtobool(str, &initramfs_async);
+ int ret;
+
+ ret = kstrtobool(str, &initramfs_async);
+ if (ret)
+ return 0;
+
return 1;
}
__setup("initramfs_async=", initramfs_async_setup);
--
2.34.1
Powered by blists - more mailing lists