Commit d8fea92f authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Yu Zhang
Browse files

KVM: x86/mmu: Use kstrtobool() instead of strtobool()

mainline inclusion
from mainline-v6.3-rc1
commit 11b36fe7
category: feature
bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I9HH9U
CVE: N/A
Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=11b36fe7d4500c8ef73677c087f302fd713101c2



-------------------------------------

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: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/670882aa04dbdd171b46d3b20ffab87158454616.1673689135.git.christophe.jaillet@wanadoo.fr


Signed-off-by: default avatarSean Christopherson <seanjc@google.com>
Signed-off-by: default avatarYu Zhang <yu.c.zhang@linux.intel.com>
parent e1b5d86b
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -42,6 +42,7 @@
#include <linux/uaccess.h>
#include <linux/hash.h>
#include <linux/kern_levels.h>
#include <linux/kstrtox.h>
#include <linux/kthread.h>

#include <asm/page.h>
@@ -6719,7 +6720,7 @@ static int set_nx_huge_pages(const char *val, const struct kernel_param *kp)
		new_val = 1;
	else if (sysfs_streq(val, "auto"))
		new_val = get_nx_auto_mode();
	else if (strtobool(val, &new_val) < 0)
	else if (kstrtobool(val, &new_val) < 0)
		return -EINVAL;

	__set_nx_huge_pages(new_val);