linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Wang Xiaoqiang <wangxq10@lzu.edu.cn>
Cc: "linux-mm@kvack.org" <linux-mm@kvack.org>
Subject: Re: [PATCH] mm/mlock.c: change can_do_mlock return value type to boolean
Date: Fri, 8 Jan 2016 14:17:37 -0800	[thread overview]
Message-ID: <20160108141737.76ccd8c350a028c47afc9c2f@linux-foundation.org> (raw)
In-Reply-To: <20160108203823.348f2a17@debian>

On Fri, 8 Jan 2016 20:38:23 +0800 Wang Xiaoqiang <wangxq10@lzu.edu.cn> wrote:

> Since can_do_mlock only return 1 or 0, so make it boolean.
> 
> No functional change.
> 
> ...
>
> --- a/mm/mlock.c
> +++ b/mm/mlock.c
> @@ -24,13 +24,13 @@
>  
>  #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);

Please never send untested patches.  Ever.

--- a/include/linux/mm.h~mm-mlockc-change-can_do_mlock-return-value-type-to-boolean-fix
+++ a/include/linux/mm.h
@@ -1100,7 +1100,7 @@ static inline bool shmem_mapping(struct
 }
 #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 *);
 

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

           reply	other threads:[~2016-01-08 22:17 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20160108203823.348f2a17@debian>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160108141737.76ccd8c350a028c47afc9c2f@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=linux-mm@kvack.org \
    --cc=wangxq10@lzu.edu.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox