Skip to content

Commit 7f43add

Browse files
wangxiaoqtorvalds
authored andcommitted
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. [[email protected]: update declaration in mm.h] Signed-off-by: Wang Xiaoqiang <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 61e1655 commit 7f43add

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

include/linux/mm.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1100,7 +1100,7 @@ static inline bool shmem_mapping(struct address_space *mapping)
11001100
}
11011101
#endif
11021102

1103-
extern int can_do_mlock(void);
1103+
extern bool can_do_mlock(void);
11041104
extern int user_shm_lock(size_t, struct user_struct *);
11051105
extern void user_shm_unlock(size_t, struct user_struct *);
11061106

mm/mlock.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@
2424

2525
#include "internal.h"
2626

27-
int can_do_mlock(void)
27+
bool can_do_mlock(void)
2828
{
2929
if (rlimit(RLIMIT_MEMLOCK) != 0)
30-
return 1;
30+
return true;
3131
if (capable(CAP_IPC_LOCK))
32-
return 1;
33-
return 0;
32+
return true;
33+
return false;
3434
}
3535
EXPORT_SYMBOL(can_do_mlock);
3636

0 commit comments

Comments
 (0)