Skip to content

Commit fcb8283

Browse files
intel-lab-lkpMarc Zyngier
authored andcommitted
KVM: arm64: Fix boolreturn.cocci warnings
arch/arm64/kvm/mmu.c:1114:9-10: WARNING: return of 0/1 in function 'kvm_age_gfn' with return type bool arch/arm64/kvm/mmu.c:1084:9-10: WARNING: return of 0/1 in function 'kvm_set_spte_gfn' with return type bool arch/arm64/kvm/mmu.c:1127:9-10: WARNING: return of 0/1 in function 'kvm_test_age_gfn' with return type bool arch/arm64/kvm/mmu.c:1070:9-10: WARNING: return of 0/1 in function 'kvm_unmap_gfn_range' with return type bool Return statements in functions returning bool should use true/false instead of 1/0. Generated by: scripts/coccinelle/misc/boolreturn.cocci Fixes: cd4c718 ("KVM: arm64: Convert to the gfn-based MMU notifier callbacks") Reported-by: kernel test robot <[email protected]> Signed-off-by: kernel test robot <[email protected]> Reviewed-by: Sean Christopherson <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/20210426223357.GA45871@cd4295a34ed8
1 parent e44b49f commit fcb8283

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

arch/arm64/kvm/mmu.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1156,21 +1156,21 @@ int kvm_handle_guest_abort(struct kvm_vcpu *vcpu)
11561156
bool kvm_unmap_gfn_range(struct kvm *kvm, struct kvm_gfn_range *range)
11571157
{
11581158
if (!kvm->arch.mmu.pgt)
1159-
return 0;
1159+
return false;
11601160

11611161
__unmap_stage2_range(&kvm->arch.mmu, range->start << PAGE_SHIFT,
11621162
(range->end - range->start) << PAGE_SHIFT,
11631163
range->may_block);
11641164

1165-
return 0;
1165+
return false;
11661166
}
11671167

11681168
bool kvm_set_spte_gfn(struct kvm *kvm, struct kvm_gfn_range *range)
11691169
{
11701170
kvm_pfn_t pfn = pte_pfn(range->pte);
11711171

11721172
if (!kvm->arch.mmu.pgt)
1173-
return 0;
1173+
return false;
11741174

11751175
WARN_ON(range->end - range->start != 1);
11761176

@@ -1190,7 +1190,7 @@ bool kvm_set_spte_gfn(struct kvm *kvm, struct kvm_gfn_range *range)
11901190
PAGE_SIZE, __pfn_to_phys(pfn),
11911191
KVM_PGTABLE_PROT_R, NULL);
11921192

1193-
return 0;
1193+
return false;
11941194
}
11951195

11961196
bool kvm_age_gfn(struct kvm *kvm, struct kvm_gfn_range *range)
@@ -1200,7 +1200,7 @@ bool kvm_age_gfn(struct kvm *kvm, struct kvm_gfn_range *range)
12001200
pte_t pte;
12011201

12021202
if (!kvm->arch.mmu.pgt)
1203-
return 0;
1203+
return false;
12041204

12051205
WARN_ON(size != PAGE_SIZE && size != PMD_SIZE && size != PUD_SIZE);
12061206

@@ -1213,7 +1213,7 @@ bool kvm_age_gfn(struct kvm *kvm, struct kvm_gfn_range *range)
12131213
bool kvm_test_age_gfn(struct kvm *kvm, struct kvm_gfn_range *range)
12141214
{
12151215
if (!kvm->arch.mmu.pgt)
1216-
return 0;
1216+
return false;
12171217

12181218
return kvm_pgtable_stage2_is_young(kvm->arch.mmu.pgt,
12191219
range->start << PAGE_SHIFT);

0 commit comments

Comments
 (0)