All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kvm: x86/mmu: Assign boolean values to a bool variable
@ 2021-01-21  7:20 Jiapeng Zhong
  0 siblings, 0 replies; only message in thread
From: Jiapeng Zhong @ 2021-01-21  7:20 UTC (permalink / raw)
  To: pbonzini
  Cc: seanjc, vkuznets, wanpengli, jmattson, joro, tglx, mingo, bp,
	hpa, kvm, linux-kernel, Jiapeng Zhong

Fix the following coccicheck warnings:

./arch/x86/kvm/mmu/mmu.c:5829:2-9: WARNING: Assignment of 0/1
to bool variable.

./arch/x86/kvm/mmu/mmu.c:2505:1-11: WARNING: Assignment of 0/1
to bool variable.

./arch/x86/kvm/mmu/mmu.c:1814:1-11: WARNING: Assignment of 0/1
to bool variable.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Zhong <abaci-bugfix@linux.alibaba.com>
---
 arch/x86/kvm/mmu/mmu.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c
index 6d16481..ced0bd5 100644
--- a/arch/x86/kvm/mmu/mmu.c
+++ b/arch/x86/kvm/mmu/mmu.c
@@ -1819,7 +1819,7 @@ static void kvm_unlink_unsync_page(struct kvm *kvm, struct kvm_mmu_page *sp)
 {
 	WARN_ON(!sp->unsync);
 	trace_kvm_mmu_sync_page(sp);
-	sp->unsync = 0;
+	sp->unsync = false;
 	--kvm->stat.mmu_unsync;
 }
 
@@ -2510,7 +2510,7 @@ static void kvm_unsync_page(struct kvm_vcpu *vcpu, struct kvm_mmu_page *sp)
 {
 	trace_kvm_mmu_unsync_page(sp);
 	++vcpu->kvm->stat.mmu_unsync;
-	sp->unsync = 1;
+	sp->unsync = true;
 
 	kvm_mmu_mark_parents_unsync(sp);
 }
@@ -5839,9 +5839,9 @@ static int set_nx_huge_pages(const char *val, const struct kernel_param *kp)
 
 	/* In "auto" mode deploy workaround only if CPU has the bug. */
 	if (sysfs_streq(val, "off"))
-		new_val = 0;
+		new_val = false;
 	else if (sysfs_streq(val, "force"))
-		new_val = 1;
+		new_val = true;
 	else if (sysfs_streq(val, "auto"))
 		new_val = get_nx_auto_mode();
 	else if (strtobool(val, &new_val) < 0)
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-01-21  7:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-21  7:20 [PATCH] kvm: x86/mmu: Assign boolean values to a bool variable Jiapeng Zhong

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.