lkml.org 
[lkml]   [2014]   [May]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 3/3] sched: Simplify return logic in sched_read_attr()
From: Michael Kerrisk <mtk.manpages@gmail.com>

Gotos are chained pointlessly here, and the 'out' label
can be dispensed with.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.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


\
 
 \ /
  Last update: 2014-05-09 18:21    [W:0.113 / U:2.528 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site