Skip to content

Commit 949bed2

Browse files
Chen-Gangtorvalds
authored andcommitted
include: mman: use bool instead of int for the return value of arch_validate_prot
For pure bool function's return value, bool is a little better more or less than int. Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Chen Gang <[email protected]> Acked-by: Michael Ellerman <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent bd804ba commit 949bed2

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

arch/powerpc/include/asm/mman.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ static inline pgprot_t arch_vm_get_page_prot(unsigned long vm_flags)
3131
}
3232
#define arch_vm_get_page_prot(vm_flags) arch_vm_get_page_prot(vm_flags)
3333

34-
static inline int arch_validate_prot(unsigned long prot)
34+
static inline bool arch_validate_prot(unsigned long prot)
3535
{
3636
if (prot & ~(PROT_READ | PROT_WRITE | PROT_EXEC | PROT_SEM | PROT_SAO))
37-
return 0;
37+
return false;
3838
if ((prot & PROT_SAO) && !cpu_has_feature(CPU_FTR_SAO))
39-
return 0;
40-
return 1;
39+
return false;
40+
return true;
4141
}
4242
#define arch_validate_prot(prot) arch_validate_prot(prot)
4343

include/linux/mman.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ static inline void vm_unacct_memory(long pages)
4949
*
5050
* Returns true if the prot flags are valid
5151
*/
52-
static inline int arch_validate_prot(unsigned long prot)
52+
static inline bool arch_validate_prot(unsigned long prot)
5353
{
5454
return (prot & ~(PROT_READ | PROT_WRITE | PROT_EXEC | PROT_SEM)) == 0;
5555
}

0 commit comments

Comments
 (0)