[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <82853b63-432d-a012-5791-139fee51a0a5@users.sourceforge.net>
Date: Wed, 18 Jan 2017 19:54:29 +0100
From: SF Markus Elfring <elfring@...rs.sourceforge.net>
To: linux-mips@...ux-mips.org,
Paul Gortmaker <paul.gortmaker@...driver.com>,
Ralf Bächle <ralf@...ux-mips.org>
Cc: LKML <linux-kernel@...r.kernel.org>,
kernel-janitors@...r.kernel.org
Subject: [PATCH 1/3] MIPS: Return directly in 32_mmap2()
From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Wed, 18 Jan 2017 19:00:05 +0100
* Return a failure indication without storing it
in an intermediate variable.
* Delete the local variable "error" which became unnecessary
with this refactoring.
Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
arch/mips/kernel/linux32.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/arch/mips/kernel/linux32.c b/arch/mips/kernel/linux32.c
index 50fb62544df7..6fa6cdfa6e22 100644
--- a/arch/mips/kernel/linux32.c
+++ b/arch/mips/kernel/linux32.c
@@ -64,15 +64,10 @@ SYSCALL_DEFINE6(32_mmap2, unsigned long, addr, unsigned long, len,
unsigned long, prot, unsigned long, flags, unsigned long, fd,
unsigned long, pgoff)
{
- unsigned long error;
-
- error = -EINVAL;
if (pgoff & (~PAGE_MASK >> 12))
- goto out;
- error = sys_mmap_pgoff(addr, len, prot, flags, fd,
- pgoff >> (PAGE_SHIFT-12));
-out:
- return error;
+ return -EINVAL;
+ return sys_mmap_pgoff(addr, len, prot, flags, fd,
+ pgoff >> (PAGE_SHIFT-12));
}
#define RLIM_INFINITY32 0x7fffffff
--
2.11.0
Powered by blists - more mailing lists