summaryrefslogtreecommitdiffstats
path: root/mm/gup.c
diff options
context:
space:
mode:
authorWei Yang <richard.weiyang@gmail.com>2018-10-26 15:07:55 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2018-10-26 16:26:34 -0700
commitd4faa40259b8524a09c1b0fcd38a446db0c0b770 (patch)
treed9fe02eaf997d41db0e0f5895e37b5e8c83e4458 /mm/gup.c
parent966cf44f637e6aeea7e3d01ba004bf8b5beac78f (diff)
downloadlinux-stable-d4faa40259b8524a09c1b0fcd38a446db0c0b770.tar.gz
linux-stable-d4faa40259b8524a09c1b0fcd38a446db0c0b770.tar.bz2
linux-stable-d4faa40259b8524a09c1b0fcd38a446db0c0b770.zip
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>
Diffstat (limited to 'mm/gup.c')
-rw-r--r--mm/gup.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/mm/gup.c b/mm/gup.c
index 1abc8b4afff6..08eb350e0f35 100644
--- a/mm/gup.c
+++ b/mm/gup.c
@@ -1780,12 +1780,11 @@ bool gup_fast_permitted(unsigned long start, int nr_pages, int write)
int __get_user_pages_fast(unsigned long start, int nr_pages, int write,
struct page **pages)
{
- unsigned long addr, len, end;
+ unsigned long len, end;
unsigned long flags;
int nr = 0;
start &= PAGE_MASK;
- addr = start;
len = (unsigned long) nr_pages << PAGE_SHIFT;
end = start + len;
@@ -1807,7 +1806,7 @@ int __get_user_pages_fast(unsigned long start, int nr_pages, int write,
if (gup_fast_permitted(start, nr_pages, write)) {
local_irq_save(flags);
- gup_pgd_range(addr, end, write, pages, &nr);
+ gup_pgd_range(start, end, write, pages, &nr);
local_irq_restore(flags);
}