linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Pingfan Liu <kernelfans@gmail.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org, "Jérôme Glisse" <jglisse@redhat.com>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"Mel Gorman" <mgorman@techsingularity.net>,
	"Jan Kara" <jack@suse.cz>,
	"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
	"Michal Hocko" <mhocko@suse.com>,
	"Mike Kravetz" <mike.kravetz@oracle.com>,
	"Andrea Arcangeli" <aarcange@redhat.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] mm/migrate: clean up useless code in migrate_vma_collect_pmd()
Date: Wed, 7 Aug 2019 13:28:58 +0800	[thread overview]
Message-ID: <20190807052858.GA9749@mypc> (raw)
In-Reply-To: <20190806133503.GC30179@bombadil.infradead.org>

On Tue, Aug 06, 2019 at 06:35:03AM -0700, Matthew Wilcox wrote:
> 
> This needs something beyond the subject line.  Maybe ...
> 
> After these assignments, we either restart the loop with a fresh variable,
> or we assign to the variable again without using the value we've assigned.
> 
> Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org>
> 
> >  			goto next;
> >  		}
> > -		pfn = page_to_pfn(page);
> 
> After you've done all this, as far as I can tell, the 'pfn' variable is
> only used in one arm of the conditions, so it can be moved there.
> 
> ie something like:
> 
> -               unsigned long mpfn, pfn;
> +               unsigned long mpfn;
> ...
> -               pfn = pte_pfn(pte);
> ...
> +                       unsigned long pfn = pte_pfn(pte);
> +
> 
This makes code better. Thank you for the suggestion. Will send v2 for
this patch.

Regards,
	Pingfan


  reply	other threads:[~2019-08-07  5:29 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-06  8:00 [PATCH 1/3] mm/migrate: clean up useless code in migrate_vma_collect_pmd() Pingfan Liu
2019-08-06  8:00 ` [PATCH 2/3] mm/migrate: see hole as invalid source page Pingfan Liu
2019-08-15 17:22   ` Jerome Glisse
2019-08-16 15:02     ` Pingfan Liu
2019-08-26  7:52       ` Pingfan Liu
2019-08-06  8:00 ` [PATCH 3/3] mm/migrate: remove the duplicated code migrate_vma_collect_hole() Pingfan Liu
2019-08-15 17:22   ` Jerome Glisse
2019-08-06 13:35 ` [PATCH 1/3] mm/migrate: clean up useless code in migrate_vma_collect_pmd() Matthew Wilcox
2019-08-07  5:28   ` Pingfan Liu [this message]
2019-08-07  8:41     ` [PATCHv2] " Pingfan Liu
2019-08-14 23:11       ` Ralph Campbell
2019-08-15 17:19       ` Jerome Glisse
2019-08-15 19:23         ` Ralph Campbell
2019-08-15 19:40           ` Jerome Glisse
2019-08-16 13:21             ` Pingfan Liu

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=20190807052858.GA9749@mypc \
    --to=kernelfans@gmail.com \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=jack@suse.cz \
    --cc=jglisse@redhat.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@techsingularity.net \
    --cc=mhocko@suse.com \
    --cc=mike.kravetz@oracle.com \
    --cc=willy@infradead.org \
    /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;
as well as URLs for NNTP newsgroup(s).