Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755479AbbKDIdk (ORCPT ); Wed, 4 Nov 2015 03:33:40 -0500 Received: from mail-wi0-f180.google.com ([209.85.212.180]:34559 "EHLO mail-wi0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751403AbbKDIdi (ORCPT ); Wed, 4 Nov 2015 03:33:38 -0500 Date: Wed, 4 Nov 2015 10:33:35 +0200 From: "Kirill A. Shutemov" To: yalin wang Cc: akpm@linux-foundation.org, kirill.shutemov@linux.intel.com, mgorman@suse.de, hannes@cmpxchg.org, riel@redhat.com, raindel@mellanox.com, willy@linux.intel.com, boaz@plexistor.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm: change tlb_finish_mmu() to be more simple Message-ID: <20151104083335.GA7795@node.shutemov.name> References: <1446622531-316-1-git-send-email-yalin.wang2010@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1446622531-316-1-git-send-email-yalin.wang2010@gmail.com> User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1549 Lines: 53 On Wed, Nov 04, 2015 at 03:35:31PM +0800, yalin wang wrote: > This patch remove unneeded *next temp variable, > make this function more simple to read. > > Signed-off-by: yalin wang > --- > mm/memory.c | 7 +++---- > 1 file changed, 3 insertions(+), 4 deletions(-) > > diff --git a/mm/memory.c b/mm/memory.c > index 7f3b9f2..f0040ed 100644 > --- a/mm/memory.c > +++ b/mm/memory.c > @@ -270,17 +270,16 @@ void tlb_flush_mmu(struct mmu_gather *tlb) > */ > void tlb_finish_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long end) > { > - struct mmu_gather_batch *batch, *next; > + struct mmu_gather_batch *batch; > > tlb_flush_mmu(tlb); > > /* keep the page table cache within bounds */ > check_pgt_cache(); > > - for (batch = tlb->local.next; batch; batch = next) { > - next = batch->next; > + for (batch = tlb->local.next; batch; batch = batch->next) Use after free? No, thanks. > free_pages((unsigned long)batch, 0); > - } > + > tlb->local.next = NULL; > } > > -- > 1.9.1 > > -- > 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: email@kvack.org -- Kirill A. Shutemov -- 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/