Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

x86/xen: 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: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Link: https://lore.kernel.org/r/e91af3c8708af38b1c57e0a2d7eb9765dda0e963.1667336095.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Juergen Gross <jgross@suse.com>

authored by

Christophe JAILLET and committed by
Juergen Gross
639b2e2f 4bff677b

+4 -2
+2 -1
arch/x86/xen/enlighten_pv.c
··· 23 23 #include <linux/start_kernel.h> 24 24 #include <linux/sched.h> 25 25 #include <linux/kprobes.h> 26 + #include <linux/kstrtox.h> 26 27 #include <linux/memblock.h> 27 28 #include <linux/export.h> 28 29 #include <linux/mm.h> ··· 114 113 static int __init parse_xen_msr_safe(char *str) 115 114 { 116 115 if (str) 117 - return strtobool(str, &xen_msr_safe); 116 + return kstrtobool(str, &xen_msr_safe); 118 117 return -EINVAL; 119 118 } 120 119 early_param("xen_msr_safe", parse_xen_msr_safe);
+2 -1
arch/x86/xen/setup.c
··· 7 7 8 8 #include <linux/init.h> 9 9 #include <linux/sched.h> 10 + #include <linux/kstrtox.h> 10 11 #include <linux/mm.h> 11 12 #include <linux/pm.h> 12 13 #include <linux/memblock.h> ··· 86 85 arg = strstr(xen_start_info->cmd_line, "xen_512gb_limit="); 87 86 if (!arg) 88 87 val = true; 89 - else if (strtobool(arg + strlen("xen_512gb_limit="), &val)) 88 + else if (kstrtobool(arg + strlen("xen_512gb_limit="), &val)) 90 89 return; 91 90 92 91 xen_512gb_limit = val;