* [kvm:queue 134/252] arch/arm64/kvm/mmu.c:1114:9-10: WARNING: return of 0/1 in function 'kvm_age_gfn' with return type bool
@ 2021-04-26 22:33 kernel test robot
2021-04-26 22:33 ` [PATCH] KVM: arm64: fix boolreturn.cocci warnings kernel test robot
0 siblings, 1 reply; 4+ messages in thread
From: kernel test robot @ 2021-04-26 22:33 UTC (permalink / raw)
To: Sean Christopherson
Cc: kbuild-all, kvm, Robert Hu, Farrah Chen, Danmei Wei,
Paolo Bonzini, Marc Zyngier
[-- Attachment #1: Type: text/plain, Size: 1094 bytes --]
tree: https://git.kernel.org/pub/scm/virt/kvm/kvm.git queue
head: 9f242010c3b46e63bc62f08fff42cef992d3801b
commit: cd4c7183522817087278b3e000b8a888f9f91b5c [134/252] KVM: arm64: Convert to the gfn-based MMU notifier callbacks
config: arm64-randconfig-c023-20210426 (attached as .config)
compiler: aarch64-linux-gcc (GCC) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
cocci warnings: (new ones prefixed by >>)
>> 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
Please review and possibly fold the followup patch.
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 41419 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] KVM: arm64: fix boolreturn.cocci warnings
2021-04-26 22:33 [kvm:queue 134/252] arch/arm64/kvm/mmu.c:1114:9-10: WARNING: return of 0/1 in function 'kvm_age_gfn' with return type bool kernel test robot
@ 2021-04-26 22:33 ` kernel test robot
2021-05-11 16:29 ` Sean Christopherson
2021-05-11 17:07 ` Marc Zyngier
0 siblings, 2 replies; 4+ messages in thread
From: kernel test robot @ 2021-04-26 22:33 UTC (permalink / raw)
To: Sean Christopherson
Cc: kbuild-all, kvm, Robert Hu, Farrah Chen, Danmei Wei,
Paolo Bonzini, Marc Zyngier, James Morse, Julien Thierry,
Suzuki K Poulose, Catalin Marinas, Will Deacon, linux-arm-kernel,
kvmarm
From: kernel test robot <lkp@intel.com>
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: cd4c71835228 ("KVM: arm64: Convert to the gfn-based MMU notifier callbacks")
CC: Sean Christopherson <seanjc@google.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---
tree: https://git.kernel.org/pub/scm/virt/kvm/kvm.git queue
head: 9f242010c3b46e63bc62f08fff42cef992d3801b
commit: cd4c7183522817087278b3e000b8a888f9f91b5c [134/252] KVM: arm64: Convert to the gfn-based MMU notifier callbacks
mmu.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
--- a/arch/arm64/kvm/mmu.c
+++ b/arch/arm64/kvm/mmu.c
@@ -1067,13 +1067,13 @@ out_unlock:
bool kvm_unmap_gfn_range(struct kvm *kvm, struct kvm_gfn_range *range)
{
if (!kvm->arch.mmu.pgt)
- return 0;
+ return false;
__unmap_stage2_range(&kvm->arch.mmu, range->start << PAGE_SHIFT,
(range->end - range->start) << PAGE_SHIFT,
range->may_block);
- return 0;
+ return false;
}
bool kvm_set_spte_gfn(struct kvm *kvm, struct kvm_gfn_range *range)
@@ -1081,7 +1081,7 @@ bool kvm_set_spte_gfn(struct kvm *kvm, s
kvm_pfn_t pfn = pte_pfn(range->pte);
if (!kvm->arch.mmu.pgt)
- return 0;
+ return false;
WARN_ON(range->end - range->start != 1);
@@ -1101,7 +1101,7 @@ bool kvm_set_spte_gfn(struct kvm *kvm, s
PAGE_SIZE, __pfn_to_phys(pfn),
KVM_PGTABLE_PROT_R, NULL);
- return 0;
+ return false;
}
bool kvm_age_gfn(struct kvm *kvm, struct kvm_gfn_range *range)
@@ -1111,7 +1111,7 @@ bool kvm_age_gfn(struct kvm *kvm, struct
pte_t pte;
if (!kvm->arch.mmu.pgt)
- return 0;
+ return false;
WARN_ON(size != PAGE_SIZE && size != PMD_SIZE && size != PUD_SIZE);
@@ -1124,7 +1124,7 @@ bool kvm_age_gfn(struct kvm *kvm, struct
bool kvm_test_age_gfn(struct kvm *kvm, struct kvm_gfn_range *range)
{
if (!kvm->arch.mmu.pgt)
- return 0;
+ return false;
return kvm_pgtable_stage2_is_young(kvm->arch.mmu.pgt,
range->start << PAGE_SHIFT);
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] KVM: arm64: fix boolreturn.cocci warnings
2021-04-26 22:33 ` [PATCH] KVM: arm64: fix boolreturn.cocci warnings kernel test robot
@ 2021-05-11 16:29 ` Sean Christopherson
2021-05-11 17:07 ` Marc Zyngier
1 sibling, 0 replies; 4+ messages in thread
From: Sean Christopherson @ 2021-05-11 16:29 UTC (permalink / raw)
To: kernel test robot
Cc: kbuild-all, kvm, Robert Hu, Farrah Chen, Danmei Wei,
Paolo Bonzini, Marc Zyngier, James Morse, Julien Thierry,
Suzuki K Poulose, Catalin Marinas, Will Deacon, linux-arm-kernel,
kvmarm
On Tue, Apr 27, 2021, kernel test robot wrote:
> From: kernel test robot <lkp@intel.com>
>
> 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: cd4c71835228 ("KVM: arm64: Convert to the gfn-based MMU notifier callbacks")
> CC: Sean Christopherson <seanjc@google.com>
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: kernel test robot <lkp@intel.com>
> ---
Reviewed-by: Sean Christopherson <seanjc@google.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] KVM: arm64: fix boolreturn.cocci warnings
2021-04-26 22:33 ` [PATCH] KVM: arm64: fix boolreturn.cocci warnings kernel test robot
2021-05-11 16:29 ` Sean Christopherson
@ 2021-05-11 17:07 ` Marc Zyngier
1 sibling, 0 replies; 4+ messages in thread
From: Marc Zyngier @ 2021-05-11 17:07 UTC (permalink / raw)
To: kernel test robot, Sean Christopherson
Cc: Danmei Wei, Will Deacon, Suzuki K Poulose, Farrah Chen,
Catalin Marinas, Paolo Bonzini, kbuild-all, Julien Thierry,
Robert Hu, kvmarm, linux-arm-kernel, kvm, James Morse
On Tue, 27 Apr 2021 06:33:57 +0800, kernel test robot wrote:
> 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
Applied to fixes, thanks!
[1/1] KVM: arm64: fix boolreturn.cocci warnings
commit: 9ff40461a0e9684d8cb60058938004ddc16fb536
Cheers,
M.
--
Without deviation from the norm, progress is not possible.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-05-11 17:07 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-26 22:33 [kvm:queue 134/252] arch/arm64/kvm/mmu.c:1114:9-10: WARNING: return of 0/1 in function 'kvm_age_gfn' with return type bool kernel test robot
2021-04-26 22:33 ` [PATCH] KVM: arm64: fix boolreturn.cocci warnings kernel test robot
2021-05-11 16:29 ` Sean Christopherson
2021-05-11 17:07 ` Marc Zyngier
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).