[tip:sched/core] sched: Simplify return logic in sched_read_attr( )

From: tip-bot for Michael Kerrisk
Date: Mon May 19 2014 - 09:09:26 EST


Commit-ID: 55854e657f9890a1f76105c698d1d52cf6c43661
Gitweb: http://git.kernel.org/tip/55854e657f9890a1f76105c698d1d52cf6c43661
Author: Michael Kerrisk <mtk.manpages@xxxxxxxxx>
AuthorDate: Fri, 9 May 2014 16:54:33 +0200
Committer: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
CommitDate: Mon, 19 May 2014 22:02:40 +0900

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@xxxxxxxxx>
Signed-off-by: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
Link: http://lkml.kernel.org/r/536CEC29.9090503@xxxxxxxxx
Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
---
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 08b6355..29c542e 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;
}

/**
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/