From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750807AbbICEAc (ORCPT ); Thu, 3 Sep 2015 00:00:32 -0400 Received: from smtpfree.forptr.21cn.com ([183.56.131.105]:46927 "EHLO 21cn.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1750701AbbICEAb (ORCPT ); Thu, 3 Sep 2015 00:00:31 -0400 HMM_SOURCE_IP: 10.64.8.31:16908.402677938 HMM_ATTACHE_NUM: 0000 HMM_SOURCE_TYPE: SMTP 0/X-Total-Score: 0: 1/X-Total-Score: 0: X-FILTER-SCORE: to=<8d8a8f96994e8c86938f868d61978886934f8c86938f868d4f909388>, score=<1441252828IIIjIIUIIDIjUDSXcoz9II11D11N11H1DNHbs3zVo111> X-REAL-FROM: gchen_5i5j@21cn.com X-Receive-IP: 124.166.242.184 Message-ID: <55E7C654.2080309@21cn.com> Date: Thu, 03 Sep 2015 12:02:28 +0800 From: Chen Gang User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 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() References: <1441252346-2323-1-git-send-email-gang.chen.5i5j@gmail.com> In-Reply-To: <1441252346-2323-1-git-send-email-gang.chen.5i5j@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > > Before the main looping, vma is already is NULL, so need not set it to > NULL, again. > > Signed-off-by: Chen Gang > --- > 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