module: Use kstrtobool() instead of strtobool()
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Tue, 1 Nov 2022 21:14:06 +0000 (22:14 +0100)
committerLuis Chamberlain <mcgrof@kernel.org>
Wed, 25 Jan 2023 22:07:21 +0000 (14:07 -0800)
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@wanadoo.fr>
Reviewed-by: Luis Chamberlain <mcgrof@kernel.org>
Reviewed-by: Aaron Tomlin <atomlin@atomlin.com>
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
kernel/module/main.c

index 4ac3fe43e6c8ff307aca9099e4917219a04595cf..d3be89de706d0f68570d1df9cd428dd860199a0d 100644 (file)
@@ -17,6 +17,7 @@
 #include <linux/fs.h>
 #include <linux/kernel.h>
 #include <linux/kernel_read_file.h>
+#include <linux/kstrtox.h>
 #include <linux/slab.h>
 #include <linux/vmalloc.h>
 #include <linux/elf.h>
@@ -2675,7 +2676,7 @@ static int unknown_module_param_cb(char *param, char *val, const char *modname,
        int ret;
 
        if (strcmp(param, "async_probe") == 0) {
-               if (strtobool(val, &mod->async_probe_requested))
+               if (kstrtobool(val, &mod->async_probe_requested))
                        mod->async_probe_requested = true;
                return 0;
        }