linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Chen Gang <gchen_5i5j@21cn.com>
To: gang.chen.5i5j@gmail.com, akpm@linux-foundation.org, mhocko@suse.cz
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/mmap.c: Remove useless statement "vma = NULL" in find_vma()
Date: Thu, 03 Sep 2015 12:02:28 +0800	[thread overview]
Message-ID: <55E7C654.2080309@21cn.com> (raw)
In-Reply-To: <1441252346-2323-1-git-send-email-gang.chen.5i5j@gmail.com>

Hello all:

I also want to consult: the comments of find_vma() says:

  "Look up the first VMA which satisfies  addr < vm_end, ..."

Is it OK? (why not "vm_start <= addr < vm_end"), need we let "vma = tmp"
in "if (tmp->vm_start <= addr)"? -- it looks the comments is not match
the implementation, precisely (maybe not 1st VMA).


Thanks.


On 9/3/15 11:52, gang.chen.5i5j@gmail.com wrote:
> From: Chen Gang <gang.chen.5i5j@gmail.com>
> 
> Before the main looping, vma is already is NULL, so need not set it to
> NULL, again.
> 
> Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
> ---
>  mm/mmap.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/mm/mmap.c b/mm/mmap.c
> index df6d5f0..4db7cf0 100644
> --- a/mm/mmap.c
> +++ b/mm/mmap.c
> @@ -2054,7 +2054,6 @@ struct vm_area_struct *find_vma(struct mm_struct *mm, unsigned long addr)
>  		return vma;
>  
>  	rb_node = mm->mm_rb.rb_node;
> -	vma = NULL;
>  
>  	while (rb_node) {
>  		struct vm_area_struct *tmp;
> 

-- 
Chen Gang (陈刚)

Open, share, and attitude like air, water, and life which God blessed

  reply	other threads:[~2015-09-03  4:02 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-03  3:52 gang.chen.5i5j
2015-09-03  4:02 ` Chen Gang [this message]
2015-09-05 14:03 Chen Gang
2015-09-07 12:36 ` Oleg Nesterov
     [not found]   ` <55EEED66.6090509@hotmail.com>
2015-09-08 14:14     ` Chen Gang
2015-09-09 16:26       ` Oleg Nesterov
     [not found]         ` <55F0B6C2.2000706@hotmail.com>
2015-09-09 22:44           ` Chen Gang
2015-09-10 18:19             ` Oleg Nesterov
2015-09-10 22:20               ` Chen Gang
2015-09-08 23:14 ` David Rientjes

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=55E7C654.2080309@21cn.com \
    --to=gchen_5i5j@21cn.com \
    --cc=akpm@linux-foundation.org \
    --cc=gang.chen.5i5j@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.cz \
    /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