Re: [PATCH] include: mman: Use bool instead of int for the return value of arch_validate_prot

2016-07-12 Thread Chen Gang
On 7/12/16 12:20, Michael Ellerman wrote: > Chen Gang writes: > >> On 7/11/16 07:47, Dave Hansen wrote: >>> On 07/09/2016 09:29 AM, cheng...@emindsoft.com.cn wrote: -static inline int arch_validate_prot(unsigned long prot) +static inline bool

Re: [PATCH] include: mman: Use bool instead of int for the return value of arch_validate_prot

2016-07-11 Thread Michael Ellerman
Chen Gang writes: > On 7/11/16 07:47, Dave Hansen wrote: >> On 07/09/2016 09:29 AM, cheng...@emindsoft.com.cn wrote: >>> -static inline int arch_validate_prot(unsigned long prot) >>> +static inline bool arch_validate_prot(unsigned long prot) >>> { >>> if (prot &

Re: [PATCH] include: mman: Use bool instead of int for the return value of arch_validate_prot

2016-07-10 Thread Dave Hansen
On 07/09/2016 09:29 AM, cheng...@emindsoft.com.cn wrote: > -static inline int arch_validate_prot(unsigned long prot) > +static inline bool arch_validate_prot(unsigned long prot) > { > if (prot & ~(PROT_READ | PROT_WRITE | PROT_EXEC | PROT_SEM | PROT_SAO)) > - return 0; > -

[PATCH] include: mman: Use bool instead of int for the return value of arch_validate_prot

2016-07-09 Thread chengang
From: Chen Gang For pure bool function's return value, bool is a little better more or less than int. And return boolean result directly. Since 'if' statement is also for boolean checking, and return boolean result, too. Signed-off-by: Chen Gang