mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: tip-bot for Michael Kerrisk <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@kernel.org,
	peterz@infradead.org, tglx@linutronix.de, mtk.manpages@gmail.com
Subject: [tip:sched/core] sched: Simplify return logic in sched_read_attr( )
Date: Thu, 22 May 2014 05:27:00 -0700	[thread overview]
Message-ID: <tip-22400674945c562cf3c176d6c4178cd545e2dec9@git.kernel.org> (raw)
In-Reply-To: <536CEC29.9090503@gmail.com>

Commit-ID:  22400674945c562cf3c176d6c4178cd545e2dec9
Gitweb:     http://git.kernel.org/tip/22400674945c562cf3c176d6c4178cd545e2dec9
Author:     Michael Kerrisk <mtk.manpages@gmail.com>
AuthorDate: Fri, 9 May 2014 16:54:33 +0200
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Thu, 22 May 2014 11:16:27 +0200

sched: Simplify return logic in sched_read_attr()

Gotos are chained pointlessly here, and the 'out' label
can be dispensed with.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/536CEC29.9090503@gmail.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 kernel/sched/core.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 2318fc4..a78c5b6 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -3821,7 +3821,7 @@ static int sched_read_attr(struct sched_attr __user *uattr,
 
 		for (; addr < end; addr++) {
 			if (*addr)
-				goto err_size;
+				return -EFBIG;
 		}
 
 		attr->size = usize;
@@ -3831,12 +3831,7 @@ static int sched_read_attr(struct sched_attr __user *uattr,
 	if (ret)
 		return -EFAULT;
 
-out:
-	return ret;
-
-err_size:
-	ret = -E2BIG;
-	goto out;
+	return 0;
 }
 
 /**

  parent reply	other threads:[~2014-05-22 12:27 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-09 14:49 [PATCH 0/3] sched: sched_setattr/sched_getattr fixes and improvements Michael Kerrisk (man-pages)
2014-05-09 14:54 ` [PATCH 1/3] sched: Make sched_setattr() correctly return -EFBIG Michael Kerrisk (man-pages)
2014-05-14  3:23   ` Michael Kerrisk (man-pages)
2014-05-19 13:06   ` [tip:sched/core] " tip-bot for Michael Kerrisk
2014-05-22 12:24   ` tip-bot for Michael Kerrisk
2014-05-09 14:54 ` [PATCH 2/3] sched: Simplify return logic in sched_copy_attr() Michael Kerrisk (man-pages)
2014-05-19 13:08   ` [tip:sched/core] sched: Simplify return logic in sched_copy_attr( ) tip-bot for Michael Kerrisk
2014-05-22 12:26   ` tip-bot for Michael Kerrisk
2014-05-09 14:54 ` [PATCH 3/3] sched: Simplify return logic in sched_read_attr() Michael Kerrisk (man-pages)
2014-05-19 13:08   ` [tip:sched/core] sched: Simplify return logic in sched_read_attr( ) tip-bot for Michael Kerrisk
2014-05-22 12:27   ` tip-bot for Michael Kerrisk [this message]
2014-05-09 17:16 ` [PATCH 0/3] sched: sched_setattr/sched_getattr fixes and improvements Peter Zijlstra
2014-05-13 18:09   ` Michael Kerrisk (man-pages)
2014-05-13 19:30     ` Peter Zijlstra

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=tip-22400674945c562cf3c176d6c4178cd545e2dec9@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=mtk.manpages@gmail.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    /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

Powered by JetHome