Skip to content

Commit fbed4fe

Browse files
tititiou36mcgrof
authored andcommitted
module: 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@wanadoo.fr> Reviewed-by: Luis Chamberlain <mcgrof@kernel.org> Reviewed-by: Aaron Tomlin <atomlin@atomlin.com> Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
1 parent def7b92 commit fbed4fe

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

kernel/module/main.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include <linux/fs.h>
1818
#include <linux/kernel.h>
1919
#include <linux/kernel_read_file.h>
20+
#include <linux/kstrtox.h>
2021
#include <linux/slab.h>
2122
#include <linux/vmalloc.h>
2223
#include <linux/elf.h>
@@ -2675,7 +2676,7 @@ static int unknown_module_param_cb(char *param, char *val, const char *modname,
26752676
int ret;
26762677

26772678
if (strcmp(param, "async_probe") == 0) {
2678-
if (strtobool(val, &mod->async_probe_requested))
2679+
if (kstrtobool(val, &mod->async_probe_requested))
26792680
mod->async_probe_requested = true;
26802681
return 0;
26812682
}

0 commit comments

Comments
 (0)