diff options
author | Markus Elfring <elfring@users.sourceforge.net> | 2017-01-18 19:30:47 +0100 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2017-01-25 02:51:11 +0100 |
commit | c9d3fdf3372d06690fd5cbc1ac5beabe52927382 (patch) | |
tree | 7512f0e37bf7eed648b5be9c67d22dd5b3209e37 /arch/mips/kernel/syscall.c | |
parent | MIPS: MT: Move an assignment for the variable "retval" in mipsmt_sys_sched_se... (diff) | |
download | linux-c9d3fdf3372d06690fd5cbc1ac5beabe52927382.tar.xz linux-c9d3fdf3372d06690fd5cbc1ac5beabe52927382.zip |
MIPS: syscall: Return directly in mips_mmap()
* Return an error code without storing it in an intermediate variable.
* Delete the local variable "result" which became unnecessary with
this refactoring.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: linux-mips@linux-mips.org
Cc: LKML <linux-kernel@vger.kernel.org>
Cc: kernel-janitors@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/15073/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/kernel/syscall.c')
-rw-r--r-- | arch/mips/kernel/syscall.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/arch/mips/kernel/syscall.c b/arch/mips/kernel/syscall.c index 833f82210528..735733fd7145 100644 --- a/arch/mips/kernel/syscall.c +++ b/arch/mips/kernel/syscall.c @@ -60,16 +60,9 @@ SYSCALL_DEFINE6(mips_mmap, unsigned long, addr, unsigned long, len, unsigned long, prot, unsigned long, flags, unsigned long, fd, off_t, offset) { - unsigned long result; - - result = -EINVAL; if (offset & ~PAGE_MASK) - goto out; - - result = sys_mmap_pgoff(addr, len, prot, flags, fd, offset >> PAGE_SHIFT); - -out: - return result; + return -EINVAL; + return sys_mmap_pgoff(addr, len, prot, flags, fd, offset >> PAGE_SHIFT); } SYSCALL_DEFINE6(mips_mmap2, unsigned long, addr, unsigned long, len, |