Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1218018 > unrolled thread

[PATCH] mm/mmap.c: Remove useless statement "vma = NULL" in find_vma()

Started bygang.chen.5i5j@gmail.com
First post2015-09-03 06:00 +0200
Last post2015-09-03 06:10 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] mm/mmap.c: Remove useless statement "vma = NULL" in find_vma() gang.chen.5i5j@gmail.com - 2015-09-03 06:00 +0200
    Re: [PATCH] mm/mmap.c: Remove useless statement "vma = NULL" in find_vma() Chen Gang <gchen_5i5j@21cn.com> - 2015-09-03 06:10 +0200

#1218018 — [PATCH] mm/mmap.c: Remove useless statement "vma = NULL" in find_vma()

Fromgang.chen.5i5j@gmail.com
Date2015-09-03 06:00 +0200
Subject[PATCH] mm/mmap.c: Remove useless statement "vma = NULL" in find_vma()
Message-ID<q4tQR-lJ-1@gated-at.bofh.it>
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;
-- 
1.9.3
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1218021

FromChen Gang <gchen_5i5j@21cn.com>
Date2015-09-03 06:10 +0200
Message-ID<q4u0x-Md-5@gated-at.bofh.it>
In reply to#1218018
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web