mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-07 13:53:24 +00:00
mm/mmap.c: remove unnecessary local variable
The local variable 'retval' is assigned just for once in __do_sys_brk(), and the function returns the value of the local variable right after the assignment. Remove unnecessary assignment and local variable declaration. Link: https://lkml.kernel.org/r/20201222103249.30683-1-adrianhuang0701@gmail.com Signed-off-by: Adrian Huang <ahuang12@lenovo.com> Acked-by: Souptick Joarder <jrdr.linux@gmail.com> Reviewed-by: David Hildenbrand <david@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
96403bfe50
commit
b7204006c8
@ -189,7 +189,6 @@ static int do_brk_flags(unsigned long addr, unsigned long request, unsigned long
|
|||||||
struct list_head *uf);
|
struct list_head *uf);
|
||||||
SYSCALL_DEFINE1(brk, unsigned long, brk)
|
SYSCALL_DEFINE1(brk, unsigned long, brk)
|
||||||
{
|
{
|
||||||
unsigned long retval;
|
|
||||||
unsigned long newbrk, oldbrk, origbrk;
|
unsigned long newbrk, oldbrk, origbrk;
|
||||||
struct mm_struct *mm = current->mm;
|
struct mm_struct *mm = current->mm;
|
||||||
struct vm_area_struct *next;
|
struct vm_area_struct *next;
|
||||||
@ -281,9 +280,8 @@ SYSCALL_DEFINE1(brk, unsigned long, brk)
|
|||||||
return brk;
|
return brk;
|
||||||
|
|
||||||
out:
|
out:
|
||||||
retval = origbrk;
|
|
||||||
mmap_write_unlock(mm);
|
mmap_write_unlock(mm);
|
||||||
return retval;
|
return origbrk;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline unsigned long vma_compute_gap(struct vm_area_struct *vma)
|
static inline unsigned long vma_compute_gap(struct vm_area_struct *vma)
|
||||||
|
Loading…
Reference in New Issue
Block a user