[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <536CEC24.9080201@gmail.com>
Date: Fri, 09 May 2014 16:54:28 +0200
From: "Michael Kerrisk (man-pages)" <mtk.manpages@...il.com>
To: Peter Zijlstra <peterz@...radead.org>
CC: mtk.manpages@...il.com, lkml <linux-kernel@...r.kernel.org>,
Juri Lelli <juri.lelli@...il.com>,
Dario Faggioli <raistlin@...ux.it>,
Ingo Molnar <mingo@...nel.org>
Subject: Re: [PATCH 2/3] sched: Simplify return logic in sched_copy_attr()
From: Michael Kerrisk <mtk.manpages@...il.com>
The logic in this function is a little contorted:
* Rather than having chained gotos for the -EFBIG case, just
return -EFBIG directly.
* Now, the label 'out' is no longer needed, and 'ret' must be zero
zero by the time we fall through to this point, so just return 0.
Signed-off-by: Michael Kerrisk <mtk.manpages@...il.com>
---
kernel/sched/core.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 6c9ce28..8fa3e12 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -3596,13 +3596,11 @@ static int sched_copy_attr(struct sched_attr __user *uattr,
*/
attr->sched_nice = clamp(attr->sched_nice, MIN_NICE, MAX_NICE);
-out:
- return ret;
+ return 0;
err_size:
put_user(sizeof(*attr), &uattr->size);
- ret = -E2BIG;
- goto out;
+ return -E2BIG;
}
/**
--
1.9.0
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists