Commit d4faa40259b8524a09c1b0fcd38a446db0c0b770

Authored by Wei Yang
Committed by Linus Torvalds
1 parent 966cf44f63

mm: remove unnecessary local variable addr in __get_user_pages_fast()

The local variable `addr' in __get_user_pages_fast() is just a shadow of
`start'.  Since `start' never changes after assignment to `addr', it is
fine to replace `start' with it.

Also the meaning of [start, end] is more obvious than [addr, end] when
passed to gup_pgd_range().

Link: http://lkml.kernel.org/r/20180925021448.20265-1-richard.weiyang@gmail.com
Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 1 changed file with 2 additions and 3 deletions Side-by-side Diff

... ... @@ -1780,12 +1780,11 @@
1780 1780 int __get_user_pages_fast(unsigned long start, int nr_pages, int write,
1781 1781 struct page **pages)
1782 1782 {
1783   - unsigned long addr, len, end;
  1783 + unsigned long len, end;
1784 1784 unsigned long flags;
1785 1785 int nr = 0;
1786 1786  
1787 1787 start &= PAGE_MASK;
1788   - addr = start;
1789 1788 len = (unsigned long) nr_pages << PAGE_SHIFT;
1790 1789 end = start + len;
1791 1790  
... ... @@ -1807,7 +1806,7 @@
1807 1806  
1808 1807 if (gup_fast_permitted(start, nr_pages, write)) {
1809 1808 local_irq_save(flags);
1810   - gup_pgd_range(addr, end, write, pages, &nr);
  1809 + gup_pgd_range(start, end, write, pages, &nr);
1811 1810 local_irq_restore(flags);
1812 1811 }
1813 1812