]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
mm/mlock.c: change can_do_mlock return value type to boolean
authorWang Xiaoqiang <wangxq10@lzu.edu.cn>
Sat, 16 Jan 2016 00:57:22 +0000 (16:57 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 16 Jan 2016 01:56:32 +0000 (17:56 -0800)
Since can_do_mlock only return 1 or 0, so make it boolean.

No functional change.

[akpm@linux-foundation.org: update declaration in mm.h]
Signed-off-by: Wang Xiaoqiang <wangxq10@lzu.edu.cn>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/mm.h
mm/mlock.c

index 1d6ec55d8b25c13938b95559e193ed454da4258e..f1cd22f2df1ac50438e7d70bb0df85c44580b8d3 100644 (file)
@@ -1100,7 +1100,7 @@ static inline bool shmem_mapping(struct address_space *mapping)
 }
 #endif
 
-extern int can_do_mlock(void);
+extern bool can_do_mlock(void);
 extern int user_shm_lock(size_t, struct user_struct *);
 extern void user_shm_unlock(size_t, struct user_struct *);
 
index 9197b6721a1ea0222e03b7eb26cda0e9c0319e62..e1e2b1207bf2ee00604468d027b3879381e1b089 100644 (file)
 
 #include "internal.h"
 
-int can_do_mlock(void)
+bool can_do_mlock(void)
 {
        if (rlimit(RLIMIT_MEMLOCK) != 0)
-               return 1;
+               return true;
        if (capable(CAP_IPC_LOCK))
-               return 1;
-       return 0;
+               return true;
+       return false;
 }
 EXPORT_SYMBOL(can_do_mlock);