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
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 &
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;
> -
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