sched: Simplify return logic in sched_read_attr()
authorMichael Kerrisk <mtk.manpages@gmail.com>
Fri, 9 May 2014 14:54:33 +0000 (16:54 +0200)
committerIngo Molnar <mingo@kernel.org>
Thu, 22 May 2014 09:16:27 +0000 (11:16 +0200)
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

index 2318fc484d8b99e5259beb7e0079bb290d7e512a..a78c5b62a470a127e55fd2560cd393283d598d67 100644 (file)
@@ -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;
 }
 
 /**