linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: SF Markus Elfring <elfring@users.sourceforge.net>
To: linux-alpha@vger.kernel.org, Al Viro <viro@zeniv.linux.org.uk>,
	Ivan Kokshaysky <ink@jurassic.park.msu.ru>,
	Jan-Benedict Glaw <jbglaw@lug-owl.de>,
	Matt Turner <mattst88@gmail.com>,
	Nicolas Pitre <nicolas.pitre@linaro.org>,
	Richard Cochran <richardcochran@gmail.com>,
	Richard Henderson <rth@twiddle.net>,
	Thomas Gleixner <tglx@linutronix.de>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: [PATCH 1/4] alpha: Return an error code only as a constant in osf_sigstack()
Date: Wed, 18 Jan 2017 12:45:13 +0100	[thread overview]
Message-ID: <95ac67c7-6a80-6d58-a8c2-43701e76ecdc@users.sourceforge.net> (raw)
In-Reply-To: <de76a580-c693-f422-ad78-d87bafd42bf3@users.sourceforge.net>

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 18 Jan 2017 10:40:51 +0100

* Return an error code without storing it in an intermediate variable.

* Delete the local variable "error" which became unnecessary with
  this refactoring.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 arch/alpha/kernel/osf_sys.c | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/arch/alpha/kernel/osf_sys.c b/arch/alpha/kernel/osf_sys.c
index 56e427c7aa3c..41174156a676 100644
--- a/arch/alpha/kernel/osf_sys.c
+++ b/arch/alpha/kernel/osf_sys.c
@@ -691,20 +691,17 @@ SYSCALL_DEFINE2(osf_sigstack, struct sigstack __user *, uss,
 	unsigned long usp = rdusp();
 	unsigned long oss_sp = current->sas_ss_sp + current->sas_ss_size;
 	unsigned long oss_os = on_sig_stack(usp);
-	int error;
 
 	if (uss) {
 		void __user *ss_sp;
 
-		error = -EFAULT;
 		if (get_user(ss_sp, &uss->ss_sp))
-			goto out;
+			return -EFAULT;
 
 		/* If the current stack was set with sigaltstack, don't
 		   swap stacks while we are on it.  */
-		error = -EPERM;
 		if (current->sas_ss_sp && on_sig_stack(usp))
-			goto out;
+			return -EPERM;
 
 		/* Since we don't know the extent of the stack, and we don't
 		   track onstack-ness, but rather calculate it, we must 
@@ -714,16 +711,12 @@ SYSCALL_DEFINE2(osf_sigstack, struct sigstack __user *, uss,
 	}
 
 	if (uoss) {
-		error = -EFAULT;
 		if (! access_ok(VERIFY_WRITE, uoss, sizeof(*uoss))
 		    || __put_user(oss_sp, &uoss->ss_sp)
 		    || __put_user(oss_os, &uoss->ss_onstack))
-			goto out;
+			return -EFAULT;
 	}
-
-	error = 0;
- out:
-	return error;
+	return 0;
 }
 
 SYSCALL_DEFINE3(osf_sysinfo, int, command, char __user *, buf, long, count)
-- 
2.11.0

  reply	other threads:[~2017-01-18 11:45 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-18 11:40 [PATCH 0/4] alpha: Fine-tuning for five function implementations SF Markus Elfring
2017-01-18 11:45 ` SF Markus Elfring [this message]
2017-01-18 11:46 ` [PATCH 2/4] alpha: Move two assignments for the variable "error" in osf_utsname() SF Markus Elfring
2017-01-18 11:47 ` [PATCH 3/4] alpha: Return directly after a failed copy_from_user() or getname() in two functions SF Markus Elfring
2017-01-18 11:50 ` [PATCH 4/4] alpha: Move two assignments for the variable "res" in srm_env_proc_write() SF Markus Elfring
2017-01-18 13:14   ` Jan-Benedict Glaw
2017-01-18 14:27     ` SF Markus Elfring
2017-01-18 14:11   ` Al Viro
2017-01-18 15:41     ` alpha: Checking source code positions for the setting of error codes SF Markus Elfring
2017-01-18 17:43       ` Al Viro
2017-01-19  0:45   ` [PATCH 4/4] alpha: Move two assignments for the variable "res" in srm_env_proc_write() kbuild test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=95ac67c7-6a80-6d58-a8c2-43701e76ecdc@users.sourceforge.net \
    --to=elfring@users.sourceforge.net \
    --cc=ink@jurassic.park.msu.ru \
    --cc=jbglaw@lug-owl.de \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-alpha@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mattst88@gmail.com \
    --cc=nicolas.pitre@linaro.org \
    --cc=richardcochran@gmail.com \
    --cc=rth@twiddle.net \
    --cc=tglx@linutronix.de \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).