sched: Simplify return logic in sched_copy_attr()
authorMichael Kerrisk <[email protected]>
Fri, 9 May 2014 14:54:28 +0000 (16:54 +0200)
committerIngo Molnar <[email protected]>
Thu, 22 May 2014 09:16:26 +0000 (11:16 +0200)
The logic in this function is a little contorted, clean it up:

  * 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 <[email protected]>
Signed-off-by: Peter Zijlstra <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
kernel/sched/core.c

index 2551b6db470e4b81eea1a7e9195414770b1942fe..2318fc484d8b99e5259beb7e0079bb290d7e512a 100644 (file)
@@ -3657,13 +3657,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;
 }
 
 /**