aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWang Xiaoqiang <wangxq10@lzu.edu.cn>2016-01-15 19:57:22 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2016-01-15 20:56:32 -0500
commit7f43add451d2a0d235074b72d254ae266a6a023f (patch)
tree5fa15d58d7acf969f3bfc898250e0ec05eb10cd3
parent61e165578dc7ec4ee044e9ca581a315d9ca9c656 (diff)
mm/mlock.c: change can_do_mlock return value type to boolean
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>
-rw-r--r--include/linux/mm.h2
-rw-r--r--mm/mlock.c8
2 files changed, 5 insertions, 5 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 1d6ec55d8b25..f1cd22f2df1a 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -1100,7 +1100,7 @@ static inline bool shmem_mapping(struct address_space *mapping)
1100} 1100}
1101#endif 1101#endif
1102 1102
1103extern int can_do_mlock(void); 1103extern bool can_do_mlock(void);
1104extern int user_shm_lock(size_t, struct user_struct *); 1104extern int user_shm_lock(size_t, struct user_struct *);
1105extern void user_shm_unlock(size_t, struct user_struct *); 1105extern void user_shm_unlock(size_t, struct user_struct *);
1106 1106
diff --git a/mm/mlock.c b/mm/mlock.c
index 9197b6721a1e..e1e2b1207bf2 100644
--- a/mm/mlock.c
+++ b/mm/mlock.c
@@ -24,13 +24,13 @@
24 24
25#include "internal.h" 25#include "internal.h"
26 26
27int can_do_mlock(void) 27bool can_do_mlock(void)
28{ 28{
29 if (rlimit(RLIMIT_MEMLOCK) != 0) 29 if (rlimit(RLIMIT_MEMLOCK) != 0)
30 return 1; 30 return true;
31 if (capable(CAP_IPC_LOCK)) 31 if (capable(CAP_IPC_LOCK))
32 return 1; 32 return true;
33 return 0; 33 return false;
34} 34}
35EXPORT_SYMBOL(can_do_mlock); 35EXPORT_SYMBOL(can_do_mlock);
36 36