[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <536CEC29.9090503@gmail.com>
Date: Fri, 09 May 2014 16:54:33 +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: [PATCH 3/3] sched: Simplify return logic in sched_read_attr()
From: Michael Kerrisk <mtk.manpages@...il.com>
Gotos are chained pointlessly here, and the 'out' label
can be dispensed with.
Signed-off-by: Michael Kerrisk <mtk.manpages@...il.com>
---
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 8fa3e12..d21c070 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -3759,7 +3759,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;
@@ -3769,12 +3769,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;
}
/**
--
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