lkml.org 
[lkml]   [2019]   [Aug]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/3] mm/migrate: clean up useless code in migrate_vma_collect_pmd()
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

\
 
 \ /
  Last update: 2019-08-07 07:31    [W:0.170 / U:0.276 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site