linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kvm: fix boolreturn.cocci warnings
       [not found] <202105251316.O1igBtAa-lkp@intel.com>
@ 2021-05-25  5:59 ` kernel test robot
  2021-05-25  7:11   ` Peter Zijlstra
  0 siblings, 1 reply; 4+ messages in thread
From: kernel test robot @ 2021-05-25  5:59 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: kbuild-all, linux-kernel, x86, Thomas Gleixner, Ingo Molnar,
	Marc Zyngier, James Morse, Alexandru Elisei, Suzuki K Poulose,
	Catalin Marinas, Will Deacon, linux-arm-kernel

From: kernel test robot <lkp@intel.com>

arch/arm64/kvm/mmu.c:1203:9-10: WARNING: return of 0/1 in function 'kvm_age_gfn' with return type bool
arch/arm64/kvm/mmu.c:1173:9-10: WARNING: return of 0/1 in function 'kvm_set_spte_gfn' with return type bool
arch/arm64/kvm/mmu.c:1216:9-10: WARNING: return of 0/1 in function 'kvm_test_age_gfn' with return type bool
arch/arm64/kvm/mmu.c:1159: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: 63b3f96e1a98 ("kvm: Select SCHED_INFO instead of TASK_DELAY_ACCT")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git sched/core
head:   9f26990074931bbf797373e53104216059b300b1
commit: 63b3f96e1a989846a5a521d4fbef4bc86406929d [7/29] kvm: Select SCHED_INFO instead of TASK_DELAY_ACCT
:::::: branch date: 13 days ago
:::::: commit date: 13 days ago

 mmu.c |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

--- a/arch/arm64/kvm/mmu.c
+++ b/arch/arm64/kvm/mmu.c
@@ -1156,13 +1156,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)
@@ -1170,7 +1170,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);
 
@@ -1190,7 +1190,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)
@@ -1200,7 +1200,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);
 
@@ -1213,7 +1213,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);

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] kvm: fix boolreturn.cocci warnings
  2021-05-25  5:59 ` [PATCH] kvm: fix boolreturn.cocci warnings kernel test robot
@ 2021-05-25  7:11   ` Peter Zijlstra
  2021-05-25  7:39     ` [kbuild-all] " Rong Chen
  0 siblings, 1 reply; 4+ messages in thread
From: Peter Zijlstra @ 2021-05-25  7:11 UTC (permalink / raw)
  To: kernel test robot
  Cc: kbuild-all, linux-kernel, x86, Thomas Gleixner, Ingo Molnar,
	Marc Zyngier, James Morse, Alexandru Elisei, Suzuki K Poulose,
	Catalin Marinas, Will Deacon, linux-arm-kernel

On Tue, May 25, 2021 at 01:59:40PM +0800, kernel test robot wrote:
> From: kernel test robot <lkp@intel.com>
> 
> arch/arm64/kvm/mmu.c:1203:9-10: WARNING: return of 0/1 in function 'kvm_age_gfn' with return type bool
> arch/arm64/kvm/mmu.c:1173:9-10: WARNING: return of 0/1 in function 'kvm_set_spte_gfn' with return type bool
> arch/arm64/kvm/mmu.c:1216:9-10: WARNING: return of 0/1 in function 'kvm_test_age_gfn' with return type bool
> arch/arm64/kvm/mmu.c:1159: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

Per 2b076054e524 ("remove boolinit.cocci"), I have a very dim view of
this sort of thing.

> Fixes: 63b3f96e1a98 ("kvm: Select SCHED_INFO instead of TASK_DELAY_ACCT")

*how* ?!?

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [kbuild-all] Re: [PATCH] kvm: fix boolreturn.cocci warnings
  2021-05-25  7:11   ` Peter Zijlstra
@ 2021-05-25  7:39     ` Rong Chen
  2021-05-25 16:46       ` Sean Christopherson
  0 siblings, 1 reply; 4+ messages in thread
From: Rong Chen @ 2021-05-25  7:39 UTC (permalink / raw)
  To: Peter Zijlstra, kernel test robot
  Cc: kbuild-all, linux-kernel, x86, Thomas Gleixner, Ingo Molnar,
	Marc Zyngier, James Morse, Alexandru Elisei, Suzuki K Poulose,
	Catalin Marinas, Will Deacon, linux-arm-kernel



On 5/25/21 3:11 PM, Peter Zijlstra wrote:
> On Tue, May 25, 2021 at 01:59:40PM +0800, kernel test robot wrote:
>> From: kernel test robot <lkp@intel.com>
>>
>> arch/arm64/kvm/mmu.c:1203:9-10: WARNING: return of 0/1 in function 'kvm_age_gfn' with return type bool
>> arch/arm64/kvm/mmu.c:1173:9-10: WARNING: return of 0/1 in function 'kvm_set_spte_gfn' with return type bool
>> arch/arm64/kvm/mmu.c:1216:9-10: WARNING: return of 0/1 in function 'kvm_test_age_gfn' with return type bool
>> arch/arm64/kvm/mmu.c:1159: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
> Per 2b076054e524 ("remove boolinit.cocci"), I have a very dim view of
> this sort of thing.

Hi Peterz,

Sorry for the noise, we'll disable the check.

>
>> Fixes: 63b3f96e1a98 ("kvm: Select SCHED_INFO instead of TASK_DELAY_ACCT")
> *how* ?!?

The bot is stupid, it used the commit that first found the issues,
we'll take a look at it.

Best Regards,
Rong Chen

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [kbuild-all] Re: [PATCH] kvm: fix boolreturn.cocci warnings
  2021-05-25  7:39     ` [kbuild-all] " Rong Chen
@ 2021-05-25 16:46       ` Sean Christopherson
  0 siblings, 0 replies; 4+ messages in thread
From: Sean Christopherson @ 2021-05-25 16:46 UTC (permalink / raw)
  To: Rong Chen
  Cc: Peter Zijlstra, kernel test robot, kbuild-all, linux-kernel, x86,
	Thomas Gleixner, Ingo Molnar, Marc Zyngier, James Morse,
	Alexandru Elisei, Suzuki K Poulose, Catalin Marinas, Will Deacon,
	linux-arm-kernel

On Tue, May 25, 2021, Rong Chen wrote:
> 
> 
> On 5/25/21 3:11 PM, Peter Zijlstra wrote:
> > On Tue, May 25, 2021 at 01:59:40PM +0800, kernel test robot wrote:
> > > From: kernel test robot <lkp@intel.com>
> > > 
> > > arch/arm64/kvm/mmu.c:1203:9-10: WARNING: return of 0/1 in function 'kvm_age_gfn' with return type bool
> > > arch/arm64/kvm/mmu.c:1173:9-10: WARNING: return of 0/1 in function 'kvm_set_spte_gfn' with return type bool
> > > arch/arm64/kvm/mmu.c:1216:9-10: WARNING: return of 0/1 in function 'kvm_test_age_gfn' with return type bool
> > > arch/arm64/kvm/mmu.c:1159: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
> > Per 2b076054e524 ("remove boolinit.cocci"), I have a very dim view of
> > this sort of thing.
> 
> Hi Peterz,
> 
> Sorry for the noise, we'll disable the check.
> 
> > 
> > > Fixes: 63b3f96e1a98 ("kvm: Select SCHED_INFO instead of TASK_DELAY_ACCT")
> > *how* ?!?
> 
> The bot is stupid

LOL.  FWIW, it's not _that_ stupid, or maybe it's the broken clock adage...  The
proper fix is sitting in the KVM tree, it should soon make its way to Linus.

  fcb8283920b1 ("KVM: arm64: Fix boolreturn.cocci warnings")

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-05-25 17:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <202105251316.O1igBtAa-lkp@intel.com>
2021-05-25  5:59 ` [PATCH] kvm: fix boolreturn.cocci warnings kernel test robot
2021-05-25  7:11   ` Peter Zijlstra
2021-05-25  7:39     ` [kbuild-all] " Rong Chen
2021-05-25 16:46       ` Sean Christopherson

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).