Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: Return true/false (not 1/0) from bool functions

./arch/mips/kernel/uprobes.c:261:8-9: WARNING: return of 0/1 in function
'arch_uprobe_skip_sstep' with return type bool
./arch/mips/kernel/uprobes.c:78:10-11: WARNING: return of 0/1 in
function 'is_trap_insn' with return type bool
./arch/mips/kvm/mmu.c:489:9-10: WARNING: return of 0/1 in function
'kvm_test_age_gfn' with return type bool
./arch/mips/kvm/mmu.c:445:8-9: WARNING: return of 0/1 in function
'kvm_unmap_gfn_range' with return type bool

Signed-off-by: Huilong Deng <denghuilong@cdjrlc.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>

authored by

Huilong Deng and committed by
Thomas Bogendoerfer
126b3936 4d2ee1be

+7 -7
+5 -5
arch/mips/kernel/uprobes.c
··· 75 75 case tlt_op: 76 76 case tltu_op: 77 77 case tne_op: 78 - return 1; 78 + return true; 79 79 } 80 80 break; 81 81 ··· 87 87 case tlti_op: 88 88 case tltiu_op: 89 89 case tnei_op: 90 - return 1; 90 + return true; 91 91 } 92 92 break; 93 93 } 94 94 95 - return 0; 95 + return false; 96 96 } 97 97 98 98 #define UPROBE_TRAP_NR ULONG_MAX ··· 254 254 * See if the instruction can be emulated. 255 255 * Returns true if instruction was emulated, false otherwise. 256 256 * 257 - * For now we always emulate so this function just returns 0. 257 + * For now we always emulate so this function just returns false. 258 258 */ 259 259 bool arch_uprobe_skip_sstep(struct arch_uprobe *auprobe, struct pt_regs *regs) 260 260 { 261 - return 0; 261 + return false; 262 262 }
+2 -2
arch/mips/kvm/mmu.c
··· 442 442 bool kvm_unmap_gfn_range(struct kvm *kvm, struct kvm_gfn_range *range) 443 443 { 444 444 kvm_mips_flush_gpa_pt(kvm, range->start, range->end); 445 - return 1; 445 + return true; 446 446 } 447 447 448 448 bool kvm_set_spte_gfn(struct kvm *kvm, struct kvm_gfn_range *range) ··· 486 486 pte_t *gpa_pte = kvm_mips_pte_for_gpa(kvm, NULL, gpa); 487 487 488 488 if (!gpa_pte) 489 - return 0; 489 + return false; 490 490 return pte_young(*gpa_pte); 491 491 } 492 492